couchman02
Programmer
Hello guys and girls, I searched the archives and didn't see what I was looking for but I know someone has had this question before. I also wanted someone to check out my code on how I'm doing it and maybe suggest a better way.
Does it seem like I'm on the right path to converting a packed-decimal file to displayable fields in working storage that I can turn around and write out to a new file that's non-packed?
FD FILE
01 RECORD
03 BANK PIC S999 COMP-3.
03 APPLICATION PIC S9 COMP-3.
03 ACCOUNT PIC S9(8) COMP-3.
WORKING-STORAGE.
01 CONVERSION-FIELDS.
05 WS-BANK PIC S999 COMP-3.
05 WS-BANK-R REDEFINES WS-BANK PIC XX.
05 WS-APPL PIC S9 COMP-3.
05 WS-APPL-R REDEFINES WS-APPL PIC X.
05 WS-ACCT PIC S9(8) COMP-3.
05 WS-ACCT-R REDEFINES WS-ACCT PIC X(8).
01 DISPLAY-FIELDS.
05 WS-DISPLAY-BANK PIC 999.
05 WS-DISPLAY-APPL PIC 99.
05 WS-DISPLAY-ACCT PIC 9(16).
PROCEDURE-DIVISION.
PERFORM 0150-CONVERSION-RTN
0150-CONVERSION-RTN.
MOVE BANK TO WS-BANK-R
MOVE WS-BANK TO WS-DISPLAY-BANK
MOVE APPLICATION TO WS-APPL-R
MOVE WS-APPL TO WS-DISPLAY-APPL
MOVE ACCOUNT TO WS-ACCT-R
MOVE WS-ACCT TO WS-DISPLAY-ACCT
DISPLAY 'WS-DISPLAY-BANK = ' WS-DISPLAY-BANK
DISPLAY 'WS-DISPLAY-APPL = ' WS-DISPLAY-APPL
DISPLAY 'WS-DISPLAY-ACCT = ' WS-DISPLAY-ACCT
I ran this and I'm not getting what I hoped to see, It's not blowing up either so I guess thats good. Any responses is very much appreciated. Oh yeah, I'm using Cobol OS/390 on the mainframe.
Thanks again,
Rookie Progammer
-Couch
Does it seem like I'm on the right path to converting a packed-decimal file to displayable fields in working storage that I can turn around and write out to a new file that's non-packed?
FD FILE
01 RECORD
03 BANK PIC S999 COMP-3.
03 APPLICATION PIC S9 COMP-3.
03 ACCOUNT PIC S9(8) COMP-3.
WORKING-STORAGE.
01 CONVERSION-FIELDS.
05 WS-BANK PIC S999 COMP-3.
05 WS-BANK-R REDEFINES WS-BANK PIC XX.
05 WS-APPL PIC S9 COMP-3.
05 WS-APPL-R REDEFINES WS-APPL PIC X.
05 WS-ACCT PIC S9(8) COMP-3.
05 WS-ACCT-R REDEFINES WS-ACCT PIC X(8).
01 DISPLAY-FIELDS.
05 WS-DISPLAY-BANK PIC 999.
05 WS-DISPLAY-APPL PIC 99.
05 WS-DISPLAY-ACCT PIC 9(16).
PROCEDURE-DIVISION.
PERFORM 0150-CONVERSION-RTN
0150-CONVERSION-RTN.
MOVE BANK TO WS-BANK-R
MOVE WS-BANK TO WS-DISPLAY-BANK
MOVE APPLICATION TO WS-APPL-R
MOVE WS-APPL TO WS-DISPLAY-APPL
MOVE ACCOUNT TO WS-ACCT-R
MOVE WS-ACCT TO WS-DISPLAY-ACCT
DISPLAY 'WS-DISPLAY-BANK = ' WS-DISPLAY-BANK
DISPLAY 'WS-DISPLAY-APPL = ' WS-DISPLAY-APPL
DISPLAY 'WS-DISPLAY-ACCT = ' WS-DISPLAY-ACCT
I ran this and I'm not getting what I hoped to see, It's not blowing up either so I guess thats good. Any responses is very much appreciated. Oh yeah, I'm using Cobol OS/390 on the mainframe.
Thanks again,
Rookie Progammer
-Couch