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

Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1785


What kind of error is trapped by on size error option?

832


What is link edit in cobol?

858


How do you reference the following file formats from cobol programs?

797


what is the difference between COBOL2 AND COBOL390?

2566






What is the difference between structured cobol programming and object alternativelyiented cobol programming?

834


What is an in line perform? When would you use it? Anything else you wish to say about it.

739


How are the next sentence and continue different from each other?

875


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?

7073


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

944


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

823


Give some examples of command terminators?

849


A table has two indexes defined. Which one will be used by the SEARCH?

873


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2155


i need a small 3d program using inline and outline.

1748