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

You have many options.

1. Use Reference modification if you want a COBOL program.
2. INSPECT will also do.
3. Use SORT, OUTREC option, it will also work.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

7306


What is difference between static and dynamic call in cobol?

1036


What do you understand by psb and acb?

846


What are the different types of condition in cobol and write their forms.

876


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?

2015


Differentiate between structured cobol programming and object-oriented cobol programming.

840


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

1071


What is redefines clause in COBOL?

1042


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2324


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

910


Why occurs cannot be used in 01 level in COBOL?

920


what is amode(24), amode(31), rmode(24) and rmode(any)?

893


How many bytes S(8) comp field occupy and its maximum value?

1859


What is the Purpose of Pointer in the string?

832


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2609