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 the difference is between continue and next sentence?

651


When is inspect verb is used in cobol?

670


HOw can I get the negative sign while deduct high value from low value

1782


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1833


Explain how you can characterize tables in cobol?

636






i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2097


What guidelines should be followed to write a structured cobol prgm?

663


What is redefines clause in COBOL?

842


input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

1773


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.

3711


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

639


what happens if parmparameter passes zero bytes to the program

1653


Write a program to explain size error.

667


What is the difference between external and global variables in COBOL?

807


Whats the difference between search & search ALL?

5244