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
What guidelines should be followed to write a structured cobol prgm?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What are the pertinent COBOL
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
how do you define single dimensional array and multidimensional array in your cobol?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is rmode(24)
) how do u code after getting data?
What is the difference between external and global variables in COBOL?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
Can we change the password using ALTER? anyone tried and changed?
What is the difference between Global and External Variables?
What is a scope terminator give example?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc