How to delete a front spaces in a data-name/variable in
cobol
Example:-
01 data-name-1 PIC x(20) value " cobol language".
01 data-name-2 PIC x(20).
MOVE data-name-1 to data-name-2.
would like the value of data-name-2 is "cobol language".
Answer Posted / anjibabu
Deepak is partially right.
01 name1 pic a(20) value ' cobol language'.
01 name2 pic a(20).
01 name3 redefines name2 pic a(14) justified right.
PD
move name1 to name3.
display name2.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
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 ......
What rules are to be followed while using the corresponding options?
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?
i want a program using by if, evaluate , string, unstring, perform, occurs?
i need a small 3d program using inline and outline.
Can a Search can be done on a table with or without Index?
What are the different rules to perform a Search?
In COBOL, what is the different between index and subscript?
what is the difference between COBOL2 AND COBOL390?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
how do you reference the rrds file formats from cobol programs
What is the LINKAGE SECTION used in COBOL?
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...)
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
What is the difference between perform … with test after and perform … with test before?