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".
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / deepak dada
01 data-name-1 pic value " cobol language" justified
right.
01 data-nane-2 pic(20).
01 data-name-3 redifines data-name-2 pic x(14).
move data-name-1 to data-name-3.
display data-name-3.
Is This Answer Correct ? | 1 Yes | 2 No |
What is the file organization clause ?
Can we move SPACES to numeric field and ZEROES to alphabetic field? If yes what are the way doing this?
I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.
What are the differences between OS VS COBOL and VS COBOL II?
What is perform what is varying?
If we use GO BACK instead of STOP RUN in cobol?
If I want to increase the Limit in GDG. What should I do?
IF I mention stop run in CICS what happens?
The maximum number of dimensions that an array can have in COBOL-85 is ?
can u plz expain me how to declare dynamic array? what is the meaning of depending on clause in dynamic array?
Why there is no questions in this column?
What is the difference between CONTINUE & NEXT SENTENCE ?