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
Which Search verb is equivalent to PERFORM…VARYING?
how do you reference the fixed unblock file formats from cobol programs
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
What is the difference between comp and comp-3?
how do you reference the printer file formats from cobol programs
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What is the utilization of copybook in cobol?
How to print 10 to 1 if the input have only 10 digit number?
what is difference between cobol and cobol/400
How do define dynamic array in cobol.
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
Write down the divisions of cobol program?
What are the pertinent COBOL
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?