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 |
Can we redefine the field of x(200) to less than 200?
if you code move high-values to variable,can you move it into numeric variable or alphanumeric variable?
The maximum number of dimensions that an array can have in COBOL-85 is ?
How much salary you are expecting? If they ask in an interview, what we have to tell?
6 Answers Tech Mahindra, Wipro,
in a indexed file what is procedure for read the records from 12 to 18. please give the code example
Why we are using comp and comp-3 in real time projects?
how to create temporary data set in jcl? what is the use?
3 Answers Cap Gemini, Temenos,
What is the Importance of GLOBAL clause According to new standards of COBOL?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
period is missing in the cobol program which error we getting
What are different file OPEN modes available in COBOL?
How will you find the currepted records in a file