Will the variable POS in the following code have a value of
2 or not?
01 POS PIC S9(4) COMP VALUE 2.
01 FIRST-NAME PIC X(10) VALUE 'ABC'.
01 LAST-NAME PIC X(10) VALUE 'XYZ'.
01 NAME PIC X(20) VALUE SPACES.
STRING FIRST-NAME DELIMITED BY SPACES
' ' DELIMITED BY SIZE
LAST-NAME DELIMITED BY SPACES
INTO NAME
WITH POINTER POS
Answers were Sorted based on User's Feedback
Answer / shobhit garg
No, It wont have value 2. rather value of POS will be 9.
Pointer specifies the number of non blank characters moved
to the receiveing string ( in our case its NAME).
So FIRST-NAME will return 3 bytes then a space then LAST-
NAME will return 3 bytes means overall 7 bytes.
Since our POS varibale starts from 2 , so overall count for
POS will be 2 + 7 = 9
| Is This Answer Correct ? | 7 Yes | 0 No |
Is It Possible to Update or change in VIEW Mode?
What do you feel makes a good program?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What are the pertinent COBOL
wht do u mean by (*,intrdr) wht is * used for ?
What is the significance of 'above the line' and 'below the line'?
give the examples of strings in cobol
In my table having 3000 Records. How can I delete the 500th row? (we don't know what is data inside the table)
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
i have a variable block which is used in my cobol program as input file having records of 4080 after compilation while runing the program im getiing file attribut mismatch and it is saying tht the record length of the file is 4084 can any one knw the answer how to reslove it ?
How many maximum number of procedures can we write in one COBOL program?
what is the diff b/w select stsmt and cursor ?