Can we move SPACES to numeric field and ZEROES to
alphabetic field? If yes what are the way doing this?
Answer Posted / siva
yes, we can move accordingly thru REDEFINES clause.
Example :
01 WS-A PIC 9(5).
01 WS-AR REDEFINES WS-A PIC X(5).
01 WS-B PIC A(5).
01 WS-BR REDEFINES WS-B PIC X(5).
MOVE 12345 TO WS-A.
MOVE SPACES TO WS-AR.
MOVE 'ABCDE' TO WS-B.
MOVE ZEROES TO WS-BR.
WS-A, WS-AR contains spaces and WS-B, WS-BR contains
zeroes.
| Is This Answer Correct ? | 19 Yes | 1 No |
Post New Answer View All Answers
Whats the difference between search & search ALL?
how do you define single dimensional array and multidimensional array in your cobol?
What are declaratives and what are their uses in cobol?
What is the difference between external and global variables in COBOL?
What is a report item?
how can i see junk values in dclgen or in hostvariable of comp ?
What is the difference between next sentence and continue in cobol programing language?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
How do get the result of your program directly on your pc?
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What kind of error is trapped by on size error option?
Why did you choose to work with ibm mainframe cobol programming?
What is difference between static and dynamic call in cobol?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc