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 is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
i want a program using by if, evaluate , string, unstring, perform, occurs?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
How do get the result of your program directly on your pc?
Why occurs cannot be used in 01 level in COBOL?
What are literals?
Explain about different table spaces.
What rules are followed by the search verb.
Write a program to explain size error.
What are 77 levels used for?
how do you reference the fixed unblock file formats from cobol programs
What is the difference between goback, stop run and exit program in cobol?
What are the pertinent COBOL commands?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
Which division and paragraphs are mandatory for a COBOL program?