How to delete a front spaces in a data-name/variable in
cobol
Example:-
01 data-name-1 PIC x(20) value " cobol language".
01 data-name-2 PIC x(20).
MOVE data-name-1 to data-name-2.
would like the value of data-name-2 is "cobol language".
Answer Posted / varun v
we can use "Inspect Tallying" also for the same. I guess
this one is more effective.
Working storage Variable:
01 data-name-1 PIC x(20) value " cobol language".
01 data-name-2 PIC x(20).
01 WS-TALLY1 PIC 9(02) VALUE ZERO.
Procedure Dvision:
Inspect data-name-1 Tallying WS-TALLY1 for leading
spaces
Move data-name-1(WS-TALLY1+1 : 20-WS-TALLY1) to
data-name-2.
Now data-name-2 should have
Value 'cobol language'.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
how to move the records from file to array table. give with code example
What is the difference between goback, stop run and exit program in cobol?
What is a SSRANGE and NOSSRANGE?
Name the sections present in data division.
Why occurs cannot be used in 01 level in COBOL?
what is amode(24), amode(31), rmode(24) and rmode(any)?
What are literals?
What is perform what is varying?
How do we get current date from system with century in COBOL?
What is a scope terminator give example?
Name the divisions, which are available in a cobol program?
State the various causes of s0c1, s0c5 and s0c7.
HOw can I get the negative sign while deduct high value from low value
how do you reference the fixed unblock file formats from cobol programs