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 report-item in COBOL?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
what are decleratives in cobol?
What is rmode(any) ?
What is the difference between comp and comp-3?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
What is the difference between comp and comp-3 usage?
How do define dynamic array in cobol.
What is the utilization of copybook in cobol?
What are the different rules of SORT operation?
how to access the file from prodution from changeman tool and to submit a file to production
how do you reference the variable unblock file formats from cobol programs
What are the different rules to perform a Search?
How many sections are there in data division in COBOL?