Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Conversion of UTF-8 to EBCDIC muralikrishnan_new COBOL Programming 1 Tue Nov 21, 2017 5:33 pm
No new posts Mainframe Blocks to Tracks conversion upendrasri JCL & VSAM 1 Sat Nov 18, 2017 10:52 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us