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 |
Can you define spufi?
How do you eliminate the duplicates?
how would find total records in files using sequential?
How long have you been working on mainframes?
What is Comp-2?
File1 has 100 records and file2 has 200 records I want to copy 50 records which are in both file into file3?
What do you mean by an alias?
My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?
how can you define a dataarea(DTAARA) IN RPG? Which spec you define it C-spec/D-spec?
what are the ARRAY operations in rpg/400?
how to check the jobs submitted by other users in the spool. Which command has to be used to check the jobs submitted .
3 Answers HCL, IBM, Mannar Company,
What are the different types of string function in PL/1?