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 |
how will you find a particular line in debugging if its a infinite loop
Can you explain function of iebgener?
what are the parameter we cannot use in procedure? How many instream we can write in single jcl? Can we call instream to catalog and catalog to instream?
List the type of locks?
Is there any other debugging tool for expeditor?
What is drda ?
suppose I have two tables a and b. Both tables are connected with ssn number as foreign key. I want to retrieve a column data from b table. How will you write a query?
Explain delete-connected tables?
Have you caused any huge mistakes for the bank?
can we describe the results of opening for input empty vsam files in a cobol program?
Define the necessity of run stats among the environment test?
How do you find whether any generations exist under a gdg base?