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
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
What is a scope terminator give example?
What is the difference between PIC 9.99 and 9v99 in COBOL?
Give some examples of command terminators?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
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
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
How to remove 2 duplicate records and copy only one using job control language?
Difference between array and sub-script ?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
How many bytes S(8) comp field occupy and its maximum value?
How do get the result of your program directly on your pc?
what is search and searchall?what is the diffrence between them?give an best example?
Explain the configuration section of a cobol program with examples of syntax.