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
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Apr 03, 2009 12:18 am    Post subject: Date conversion using DFSORT
Reply with quote

Hello,

I have an input FB file of 80 bytes. Julian date is in position 28.

Code:
VIEW       CCSDLTQX.TRANS.BU6518IR.G0001V00                Columns 00001 00072
Command ===>                                                  Scroll ===> CSR
****** ***************************** Top of Data *****************************
000001 0010010000108256519710181  090840000099999960090325255MICR JOHN M SMITH
000002 0010010000108256519710182  090840000099999960090325255MICR JOHN M SMITH
000003 0010010000108256519710183  090840000099999960090325255MICR JOHN M SMITH
000004 0010010000108256519710184  090840000099999960090325255MICR JOHN M SMITH



Apart from reformatting the other fields,I need to convert the julian date into Gregorian format. In the output file (80 byte length),it would be in position 70.

Can you please assist?
Date conversion using DFSORT
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 Apr 03, 2009 12:50 am    Post subject:
Reply with quote

Please show the expected output records for your example input records.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Apr 03, 2009 12:57 am    Post subject:
Reply with quote

Input :

Code:

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 0010010000108256519710181  090840000099999960090325255MICR JOHN M SMITH
000002 0010010000108256519710182  090840000099999960090325255MICR JOHN M SMITH


Output:

Code:

 Command ===>                                                  Scroll ===> CSR 
  =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 ****** ***************************** Top of Data ******************************
 000001          00000999999051971018120090325                                 
 000002          00000999999051971018220090325                                 


Code:

  SORT FIELDS=COPY             
  OUTREC BUILD=(09:33,11,       
              20:C'0',       
              21:17,09,       
              30:?????)


I need to place the date in position 30.
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 Apr 03, 2009 1:17 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed all of your dates were '20yy' dates as shown in your example.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=INIT,
     BUILD=(9:33,11,20:C'0',21:17,9,
       30:X'01',28,5,ZD,TO=PD,LENGTH=3)),
    IFTHEN=(WHEN=INIT,OVERLAY=(30:30,4,DT1))
/*
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Apr 03, 2009 1:35 am    Post subject:
Reply with quote

Thanks a bunch Frank. It works perfectly.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Fri Apr 03, 2009 8:34 pm    Post subject:
Reply with quote

Frank,

I had to make some more modifications as per the requirement. I had to add for position 36.

Control card now looks like:

Code:
OPTION COPY                                           
  INREC IFOUTLEN=80,                                   
  IFTHEN=(WHEN=INIT,                                   
  BUILD=(1:C'38796518',                               
         9:33,11,                                     
         20:C'0',                                     
         21:17,9,                                     
         36:55,15,                                     
         30:X'01',28,5,ZD,TO=PD,LENGTH=3)),           
  IFTHEN=(WHEN=INIT,OVERLAY=(30:30,4,DT1))             
  OUTFIL REMOVECC,                                     
  TRAILER1=(1:'T',10:TOT=(09,11,ZD,M11,LENGTH=11),     
  25:COUNT=(M11,LENGTH=10))                           



The job gives me this error:

Code:
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1           
ICE126A 2 INCONSISTENT *INREC   IFTHEN 1 REFORMATTING FIELD FOUND
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705     
ICE052I 3 END OF DFSORT                                         


Any advice please?
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 Apr 03, 2009 9:09 pm    Post subject:
Reply with quote

Since you added 36:55,15, the converted date must now start at 51, not 30. The correct DFSORT control statements would be:

Code:

  OPTION COPY
  INREC IFOUTLEN=80,
  IFTHEN=(WHEN=INIT,
  BUILD=(1:C'38796518',
         9:33,11,
         20:C'0',
         21:17,9,
         36:55,15,
         51:X'01',28,5,ZD,TO=PD,LENGTH=3)),
  IFTHEN=(WHEN=INIT,OVERLAY=(51:51,4,DT1))
  OUTFIL REMOVECC,
  TRAILER1=(1:'T',10:TOT=(09,11,ZD,M11,LENGTH=11),
  25:COUNT=(M11,LENGTH=10))
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed Apr 08, 2009 6:16 am    Post subject: Reply to: Date conversion using DFSORT
Reply with quote

That works. Thank you very much.
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