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
State the various causes of s0c1, s0c5 and s0c7.
Explain how to differentiate call by context by comparing it to other calls?
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
i need a small 3d program using inline and outline.
How do you get the data to code the BMS macro?
What are the different types of condition in cobol and write their forms.
Which division and paragraphs are mandatory for a COBOL program?
What kind of error is trapped by on size error option?
Write a program to explain size error.
Are you comfortable in cobol or jcl?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
how do you reference the printer file formats from cobol programs
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
Define static linking and dynamic linking.
i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this