What is the difference between Verify & Index in PL/1?

Answers were Sorted based on User's Feedback



What is the difference between Verify & Index in PL/1?..

Answer / sneha

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

What is the difference between Verify & Index in PL/1?..

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

Post New Answer

More IBM MainFrame AllOther Interview Questions

how do we prepare test data using file-aid tool?

0 Answers   Syntel,


difference between   wrkobj &  dspobjd?

1 Answers  


How to move a field DT 9(8) of input file to DT 9(8) COMP-3 in output file in ezytrieve? in the output file entire dt is not moved.If any answer plz reply as soon as possible.

0 Answers  


Attended Xansa Interview , Asked Questions : 1) Diff between Renames and Redefines 2) Comp and Comp -3 3) What will happen if DISP = ( NEW, DELETE, KEEP) 4) Gave one scenario like , if PIC clause X(50) has to be increased to X(70) how u will proceed with this change. 5) Diff between Section and Paragraph

4 Answers   Xansa,


can i use abend-aid instead of x-ped ?

1 Answers  






How is next sentence and continue different?

0 Answers  


how is the future of tandem mainframe?

0 Answers  


What is the need to code commits in batch programs?

0 Answers  


Determine the total no of bytes in the following 01 rec1 . 02 a pic x(6). 02 b redefines a. 03 c occurs 6 times pic 9. 02 d occurs 4 times. 03 e pic x(5). 03 f pic 999. a)38. b)44 c)14 d)32

3 Answers   Accenture,


How do you write from PL/1 code to JCL?

0 Answers   IBM,


How do you use sub-string as a Pseudo-variable in PL/1? How can we use the variables?

1 Answers   IBM,


suppose program A is calling program B, at a time A will send 100 records but it has to send 500 records. how it will possible?

0 Answers  


Categories