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
how do you reference the variable unblock file formats from cobol programs
What is the difference between comp and comp-3?
i want a program using by if, evaluate , string, unstring, perform, occurs?
Name the divisions, which are available in a cobol program?
Discuss about changing dataset name in proc.
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is the compute verb? How is it used?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
1.give the details about WHEN OTHER. 2. how many form are available in evaluate.
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
How to remove 2 duplicate records and copy only one using job control language?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?