MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COMP-3 conversions

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rasprasads
Beginner


Joined: 10 Dec 2002
Posts: 59
Topics: 20
Location: Chennai

PostPosted: Fri Dec 13, 2002 9:51 am    Post subject: COMP-3 conversions Reply with quote

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
View user's profile Send private message
Mike Tebb
Beginner


Joined: 02 Dec 2002
Posts: 20
Topics: 0
Location: Yorkshire, England

PostPosted: Fri Dec 13, 2002 10:16 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group