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 ?    37 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

When are scope terminators compulsory?

0 Answers  


Express the distinction between jes2 and jes3?

0 Answers  


hi provide info about any real time requirement in health care and banking services mainframe applications. pls send immediate reply to me.

0 Answers  


What is a configuration management system, give examples?

0 Answers  


what is the meaning of ssrange and nossrange?

0 Answers   IBM,






What is the binary search?

0 Answers  


How long have you been working on mainframes?

0 Answers  


can we describe the results of opening for input empty vsam files in a cobol program?

0 Answers   IBM,


This was on MQseries. What does MQ queue Manager do? what are the different types of queues? do you know about remote queues etc. How do you delete records from queues? how do you empty queues?

1 Answers  


by using xpeditor if we want to debug the subpgm, how can you code in x-ped for mai-pgm n sub-pgm ?

0 Answers  


How many module come in Ibm framework?

0 Answers   IBM,


What is meant by deadlock in db2?

0 Answers  


Categories