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
 

 

Date conversion using DFSORT

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

New User


Joined: 29 Jan 2007
Posts: 33
Location: chennai

PostPosted: Tue Mar 17, 2009 6:01 pm    Post subject: Date conversion using DFSORT
Reply with quote

Hi, I want to convert a julian date format yyyyddd to gregorian date format in yyyy-mm-dd. that is I need the ' - ' in the date format. Please let me know how to acheive that

Date conversion using DFSORT
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Mar 17, 2009 8:35 pm    Post subject:
Reply with quote

Take a look at DATE1(c)...
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 17, 2009 9:40 pm    Post subject:
Reply with quote

bamohan,

What is the starting position and format (CH, PD?) of your input julian date?

What is the starting position of your output gregorian date.

What is the RECFM and LRECL of the input file and output file?

CICS guy,

DATE1(c) creates a constant for the current date. The OP is asking about converting a field in julian date format to a field in gregorian date format which has nothing to do with DATE1(c).
Back to top
View user's profile Send private message
bamohan

New User


Joined: 29 Jan 2007
Posts: 33
Location: chennai

PostPosted: Wed Mar 18, 2009 12:05 pm    Post subject:
Reply with quote

Hi,

Input File RECORD LENTH is 814 and O/p File REC LENGTH is 58. Record Format is FB for both.

The Input file Julian date starts from the position 484 - 487. Julian date is in the format yyyyddd. The o/p gregorian date should start from the position 18 in the o/p file and in the format YYYY-MM-DD.

Please help !!!
Back to top
View user's profile Send private message
vinothsubramanian

New User


Joined: 01 Sep 2006
Posts: 39
Location: Chennai, India

PostPosted: Wed Mar 18, 2009 8:22 pm    Post subject: Try this
Reply with quote

Hi Bamohan,

I assume that the Julian date is in PD format from 484 to 487.

Try the following code and let us know your result:

Code:
  SORT FIELDS=COPY                                           
  INREC FIELDS=(18:484,1,CHANGE=(1,X'19',X'00',X'20',X'01'), 
   NOMATCH=(X'02'),19:485,3)                               
  OUTREC OVERLAY=(18:18,4,DT1,26:24,2,23:22,2,22:C'-',25:C'-')

Regards,
Ram.
Back to top
View user's profile Send private message
vinothsubramanian

New User


Joined: 01 Sep 2006
Posts: 39
Location: Chennai, India

PostPosted: Thu Mar 19, 2009 10:41 am    Post subject: And this as well
Reply with quote

You can try also this:
Code:
  SORT FIELDS=COPY                                               
  INREC FIELDS=(18:484,1,CHANGE=(1,X'19',X'00',X'20',X'01'),     
   NOMATCH=(X'02'),19:485,3)                                   
  OUTREC OVERLAY=(18:18,4,DT1,22:22,4,ZD,EDIT=(-TT-TT))           


I am not sure whether the above code is an optimum solution. icon_sad.gif But still it can be one of the working solution. icon_wink.gif

Regards,
Ram.
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 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
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm


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