Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

can DFSORT convert a JUlian-date to mm-dd-yyyyy format.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
aqilis

New User


Joined: 23 Feb 2007
Posts: 17
Location: NOIDA

PostPosted: Tue Mar 06, 2007 2:13 pm    Post subject: can DFSORT convert a JUlian-date to mm-dd-yyyyy format.
Reply with quote

Hi ,

can DFSORT convert a JUlian-date to mm-dd-yyyyy format.
please give the code if possible.

Thanks.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 06, 2007 2:33 pm    Post subject:
Reply with quote

What is the format of the julian date? Zoned or packed decimal? Have you looked at the manual?
Back to top
View user's profile Send private message
aqilis

New User


Joined: 23 Feb 2007
Posts: 17
Location: NOIDA

PostPosted: Tue Mar 06, 2007 4:01 pm    Post subject: Re: can DFSORT convert a JUlian-date to mm-dd-yyyyy format.
Reply with quote

William,

It is in Zoned-Decimal format: CP-END-DATE PIC 9(5)


Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 06, 2007 4:15 pm    Post subject:
Reply with quote

As in YYDDD?
Have you looked at the manual?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Mar 06, 2007 8:53 pm    Post subject:
Reply with quote

Do the yyddd dates all represent 20yyddd dates or do they represent 19yyddd and 20yyddd dates?
Back to top
View user's profile Send private message
aqilis

New User


Joined: 23 Feb 2007
Posts: 17
Location: NOIDA

PostPosted: Thu Mar 08, 2007 12:23 pm    Post subject: Re: can DFSORT convert a JUlian-date to mm-dd-yyyyy format.
Reply with quote

Frank,

I think it will be 20-.
But can you give me the procedure for both of the cases.

Thanks regards

aquilis
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 08, 2007 9:48 pm    Post subject:
Reply with quote

aquilis,

Here's a DFSORT job that shows how to do what you asked for. I assumed that your yyddd field is in positions 1-5 and you want a century window of 1950-2049.

Code:

//S1    EXEC  PGM=ICEMAN                           
//SYSOUT    DD  SYSOUT=*                           
//SORTIN DD *
06012
51001
50001
07100
49001
99012
/*                                               
//SORTOUT DD SYSOUT=*                               
//SYSIN    DD    *                                 
  OPTION COPY                                       
* If yy > 49, convert Z'yyddd' to X'00yydddC'       
  INREC IFTHEN=(WHEN=(1,2,ZD,GT,+49),               
    BUILD=(X'00',1,5,ZD,TO=PD,LENGTH=3)),           
* If yy <= 49, convert Z'yyddd' to X'01yydddC'     
   IFTHEN=(WHEN=NONE,                               
    BUILD=(X'01',1,5,ZD,TO=PD,LENGTH=3))           
* Convert to X'00yydddC' to Z'19yymmdd'.           
* Convert to X'01yydddC' to Z'20yymmdd'.           
  OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,DT1)),       
* Convert to Z'ccyymmdd' to C'mm-dd-ccyy'.         
   IFTHEN=(WHEN=INIT,                               
    BUILD=(5,2,C'-',7,2,C'-',1,4))                 
/*


SORTOUT will have:

Code:

01-12-2006
01-01-1951
01-01-1950
04-10-2007
01-01-2049
01-12-1999
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Nov 20, 2009 11:39 pm    Post subject:
Reply with quote

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), you now use DFSORT's new date conversion functions to do this kind of thing quite easily, like so:

Code:

//S2    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
06012
51001
50001
07100
49001
99012
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
   OPTION COPY,Y2PAST=1950
   INREC BUILD=(1,5,Y2T,TOGREG=Y4W(-))
/*


For complete details on date conversion functions and the other new functions available with the Nov, 2009 DFSORT PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000174
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us