How to delete leading spaces/blank in COBOL ?
Example:- 01 data-name-1 pic x(220) " English is a
language".
I would like to delete leading spaces.
Answer Posted / prasanth
Wroking storage Variable:
01 WS-VAR PIC X(15) VALUE ' COBOL'.
01 WS-VAR-FINAL PIC X(15).
01 WS-TALLY1 PIC 9(02) VALUE ZERO.
Procedure division
INITIALIZE WS-TALLY
MOVE ID-TBL-IMMS OF TBL TO WS-USERID-TEMP
INSPECT WS-USERID-TEMP TALLYING WS-TALLY
FOR LEADING SPACE
MOVE WS-TALLY TO WS-TEMP
IF WS-TALLY IS NOT ZERO
MOVE WS-USERID-TEMP(WS-TALLY + 1 : ) TO WS-LS-USERID
| Is This Answer Correct ? | 6 Yes | 10 No |
Post New Answer View All Answers
What is the difference between external and global variables in COBOL?
What rules are followed by the search verb.
What is static and dynamic call in cobol?
What are different data types in cobol?
What are the various section in data division and briefly explain them.
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
How do get the result of your program directly on your pc?
When is inspect verb is used in cobol?
i want a program using by if, evaluate , string, unstring, perform, occurs?
How to print 10 to 1 if the input have only 10 digit number?
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?
How do you get the data to code the BMS macro?
Difference between cobol and cobol-ii?
what is amode(24), amode(31), rmode(24) and rmode(any)?