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 is the utilization of copybook in cobol?
What are the different data types in cobol?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
What is the difference between PIC 9.99 and PIC9v99?
What is difference between static and dynamic call in cobol?
Can a Search can be done on a table with or without Index?
Mention the guidelines to write a structured cobol program?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
What is the difference between a binary search and a sequential search what are the pertinent cobol?
what happens if parmparameter passes zero bytes to the program
What type of SDLC u followed? Why?
What are the different rules to perform a Search?
What is the difference between comp and comp-3?
Define static linking and dynamic linking.
What is the difference between perform … with test after and perform … with test before?