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
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
How do you differentiate between cobol and cobol-ii?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
what is difference between cobol and cobol/400
Define static linking and dynamic linking.
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
Explain what you understand by passing by value.
How do you get the data to code the BMS macro?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
What is the difference between comp and comp-3?
How do get the result of your program directly on your pc?
What are the different rules of SORT operation?