What is the difference between Verify & Index in PL/1?
Answers were Sorted based on User's Feedback
VERIFY
Indicates the position in string x of the first character thats not in string y. if all r there it returns 0
example: VERIFY(SAM,SAM)returns 0
VERIFY(ABCD,EREE) returns 1
INDEX
Returns the starting position of the string y within x; returns 0 if y is not there in x
example: index(sam,agt) returns 2
index(sam,dog) returns 0
| Is This Answer Correct ? | 38 Yes | 13 No |
Answer / kanishk kumar
INDEX::
Returns the starting position of the string y within string
x; returns 0 if y not present in x.
>>--INDEX--(--x--,--y--)------------------------------------
------------><
Verify::
Returns the first position in string 1 where any element in
string 2 is not in string 1.
If all characters in x are
contained in y, result is zero.
>>--VERIFY--(--x--,--y--)-----------------------------------
------------><
Example: IF VERIFY(NAME,ALPHABET) THEN...;
DCL MAINSTR CHAR(6) INIT ('ANUK ');
DCL SUBSTRG CHAR(2) INIT ('NA');
RTN = VERIFY(MAINSTR, SUBSTRG);
Default search starts from 1st position.
RTN=3
| Is This Answer Correct ? | 15 Yes | 21 No |
Total no of bytes in the following 01 rec-1 02 first-group 03 a1 pic x(4). 03 a2 pic 99. 02 second-group redefines first-group. 03 A3 pic999. 03 A4 pic 999. 02 third-group. 03 A5 occurs 5 times pic 99. A)22 B)16 C)12 D)10
execution of a subordinate module is caused by the use of the cobol verbs ------------in the superior module
In a test environment, is there a need to run a runstats?
Is the order of the when clause significant in an evaluate statement?
Can you name a few software running under the mainframe?
What is meant by comp-3 and what is it used for?
1) What is ONCODE (Return code) in PL/1? 2) How to handle the ONCODE in PL/1? Please give me some examples?
What is a configuration management system, give examples?
Is therE anybody who knows about TICKLER FILE of RM.??thank you
How to compare two files by using sort?
Which is the difference between delimited by size and delimited by space?
What is the mainframe computer?