How do you make spaces and dashes in COBOL -
i having bit of trouble cobol homework. have make program writes out names of people , social security numbers. have toy make number 123456789 show 123-45-6789 , name jsdoe show j s doe. can me out?
you should like.
01 toynumber pic 9(9). 01 yournumber. 03 pic x(3). 03 b pic x(2). 03 c pic x(4). 01 outnumber. 03 a1 pic x(3). 03 filler pic x value "-". 03 b1 pic x(2). 03 filler pic x value "-". 03 c1 pic x(4).
and in procedure:
move 123456789 toynumber. .... move toynumber yournumber. move a1. move b b1. move c c1. display outnumber.
or may use "move corresponding" if allowed in homework.
hope help!
ps: trick name same ...
Comments
Post a Comment