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 |
I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non-duplicate that will be move to valid file.thank you
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
S9(5)V9(2) occupies how many bytes memory ?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
What are some examples of command terminators?
What is the default value of DISP parameter?
Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above
How to covert given string into ASCII value in COBOL/MF COBOL
what r the types of perform statement
How to read the last 100 records from a COBOL file. The file contains N number of records.
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
In COBOL, what is the different between index and subscript?
0 Answers TryTechnicals Pvt Ltd,