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
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What kind of error is trapped by on size error option?
What is a report item?
What is the use of intialize verb?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
What rules are followed by the search verb.
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
How do we get current date from system with century in COBOL?
what is search and searchall?what is the diffrence between them?give an best example?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What is rmode(24)
How can you get the ksds file records into your cobol program?
Can a Search can be done on a table with or without Index?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
What are various search techniques in cobol? Explain.