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


Please Help Members By Posting Answers For Below Questions

What is the difference between a binary search and a sequential search what are the pertinent cobol?

735


What are the different types of condition in cobol and write their forms.

658


What are the different rules for performing sort operation?

763


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?

6829


How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?

648






IF I mention stop run in CICS what happens?

1896


how to move the records from file to array table. give with code example

2219


How to remove 2 duplicate records and copy only one using job control language?

753


What is static and dynamic call in cobol?

594


When is inspect verb is used in cobol?

675


What is the difference between Global and External Variables?

666


What is a SSRANGE and NOSSRANGE?

820


What is the default value(s) for an initialize and what keyword allows for an override of the default?

697


how do you define single dimensional array and multidimensional array in your cobol?

674


Mention the guidelines to write a structured cobol program?

620