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
What is the difference between a binary search and a sequential search what are the pertinent cobol?
What are the different types of condition in cobol and write their forms.
What are the different rules for performing sort operation?
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?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
IF I mention stop run in CICS what happens?
how to move the records from file to array table. give with code example
How to remove 2 duplicate records and copy only one using job control language?
What is static and dynamic call in cobol?
When is inspect verb is used in cobol?
What is the difference between Global and External Variables?
What is a SSRANGE and NOSSRANGE?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
how do you define single dimensional array and multidimensional array in your cobol?
Mention the guidelines to write a structured cobol program?