View previous topic :: View next topic |
Author |
Message |
rasprasads Beginner
Joined: 10 Dec 2002 Posts: 59 Topics: 20 Location: Chennai
|
Posted: Fri Dec 13, 2002 9:51 am Post subject: COMP-3 conversions |
|
|
I have a date stored in a COMP-3 field say WS-DATE(In YYYYMMDD format).
Now i need to check the month.
Apart from performing some tedious calculations is there any other way to find the month.... _________________ Rasprasad S |
|
Back to top |
|
|
Mike Tebb Beginner
Joined: 02 Dec 2002 Posts: 20 Topics: 0 Location: Yorkshire, England
|
Posted: Fri Dec 13, 2002 10:16 am Post subject: |
|
|
Code: |
03 WS-COMP-DATE PIC S9(9) COMP-3 VALUE 20021213.
03 WS-PIC-DATE PIC 9(9).
03 WS-PIC-DATE2 REDEFINES WS-PIC-DATE.
05 FILLER PIC 9.
05 WS-PIC-DATE-YYYY PIC 9(4).
05 WS-PIC-DATE-MM PIC 9(2).
05 WS-PIC-DATE-DD PIC 9(2).
MOVE WS-COMP-DATE TO WS-PIC-DATE
|
You can then test IF WS-PIC-DATE-MM = 12 or whatever. _________________ Cheers - Mike |
|
Back to top |
|
|
|
|