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 |
how can we code index in an array of cobol pgm?
what is the meaning of pic 9(09)v99-
Explain about Redefines cluse?
What type of SDLC u followed? Why?
Difference between ps, esds
TYPES OF SORTINGS. which is more prefarable.
what is the difference between start and startbr?
A s9(4). B v9(4) value 0.21 can i move this?
How to use the same COBOL program in Batch and CICS on lines? explain with an example
Size of a column has been changed in DB2 table (Suppose it was of 5 characters and later changed to 4 characters) and forgot to change the DCLGEN in COBOL program, what will happen during the execution of code? If the program Abends then what will be the error? If it doesn't abend then hpw the error can be catched?
how to transfer the file from pc to mainframe??
What is the LINKAGE SECTION used for?