IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Date conversion using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

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

Take a look at DATE1(c)...
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Mar 17, 2009 9:40 pm
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts 10 byte RBA conversion DB2 2
Search our Forums:

Back to Top