How to delete leading spaces/blank in COBOL ?
Example:- 01 data-name-1 pic x(220) " English is a
language".
I would like to delete leading spaces.
Answer Posted / varun v
Yes, we can use "Inspect Tallying" for the same.
Wroking storage Variable:
01 WS-VAR PIC X(15) VALUE ' COBOL'.
01 WS-VAR-FINAL PIC X(15).
01 WS-TALLY1 PIC 9(02) VALUE ZERO.
Procedure Dvision:
Inspect WS-VAR Tallying WS-TALLY1 for leading spaces
Move WS-VAR(WS-TALLY1+1 : 15-WS-TALLY1) to
WS-VAR-FINAL.
Now WS-INSPECT-FINAL should have
Value 'COBOL'.
| Is This Answer Correct ? | 50 Yes | 12 No |
Post New Answer View All Answers
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
what is difference between cobol and cobol/400
Give some examples of command terminators?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is static and dynamic call in cobol?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
Which Search verb is equivalent to PERFORM…VARYING?
What are various search techniques in cobol? Explain.
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?
Have you used comp and comp-3 in your project? And how?
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
What are the cobol coding sheets?
What is rmode(24)