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 / minarul

you can do this by defining another varible with JUSTIFIED
RIGHT clause. then move the value from data-name-1 to that
varible. You have to define the picture clause of that
varible with proper length : below code will exactly do
that:

01 data-name-1 pic x(220) " English is a language".
01 CHR6 PIC X(217) JUSTIFIED RIGHT.
now do a move from data-name-1 to CHR6 and then disolay
the content of CHR6

Is This Answer Correct ?    20 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do define dynamic array in cobol.

661


how to convert the recors form vsam file to db2 table tru file aid

2747


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1946


What are the cobol coding sheets?

655


Which division and paragraphs are mandatory for a COBOL program?

703






I have a File that has duplicate records. I need only those records that occur more than thrice.?

8602


Why would you use find and get rather than to obtain?

673


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

704


What is Pic 9v99 Indicates in COBOL?

714


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

883


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

693


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?

2091


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.

1998


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1915


what happens if parmparameter passes zero bytes to the program

1650