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 happens if parmparameter passes zero bytes to the program
Explain about different table spaces.
What is the default value(s) for an initialize and what keyword allows for an override of the default?
Write a program to explain size error.
I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
Write some characteristics of cobol as means of business language.
How do u write test cases?
Why did you choose to work with ibm mainframe cobol programming?
How many sections are there in data division in COBOL?
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?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
how do you reference the variable unblock file formats from cobol programs
Difference between cobol and cobol-ii?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad