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 / varun v
Yes, we can use "Inspect Tallying" for the same.
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 Dvision:
Inspect WS-VAR Tallying WS-TALLY1 for leading spaces
Move WS-VAR(WS-TALLY1+1 : 15-WS-TALLY1) to
WS-VAR-FINAL.
Now WS-INSPECT-FINAL should have
Value 'COBOL'.
| Is This Answer Correct ? | 50 Yes | 12 No |
Post New Answer View All Answers
What is the difference between goback, stop run and exit program in cobol?
How do get the result of your program directly on your pc?
How you can characterize tables in cobol?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
How to know whether the module is dynamical or statistical?
Write the code to count the sum of n natural numbers.
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
Differentiate between structured cobol programming and object-oriented cobol programming.
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
What is the difference between Call and a Link?
State the various causes of s0c1, s0c5 and s0c7.
I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What are the access modes of START statement?
HOw can I get the negative sign while deduct high value from low value