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 to transfer the file from pc to mainframe??
Can printer files (having 133 characters) be of variable length?
How To move a value to an array using move verb?
Which Search verb is equivalent to PERFORM…VARYING?
created cluster using IDCAMS ..that is empty ..when i write a program for read using Input ..wil it open the cluster or gives any error?
what modification we need to do in jcl if we use sort in cobol? I mean whether we need to include tempary file used for sorting in assign statement?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
can any one give good example for cond 88 level number and for renames pls urgent dudes ?
If a file has 1000 records.. if i have to replace the first and last characters of the file with another character. how it can be done....
i have a file which contains records like 10,30,90,50,20,40,80,60,70 i want to display these records in reverse order like 70,60,80,40,20,50,90,30,10 please give me the cobol code (do not sort the records)
3 Answers Cap Gemini, Mind Tree,
What is the difference between COMP & COMP-3 ?
how to transfer the file from pc to mainframe??