Calculate the Julian date difference in input file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Calculate the Julian date difference in input file

Postby Prasanna G » Wed Apr 24, 2013 9:51 am

Hi

I have an input file with record length 80. There are four fields in the input file. The record layout is as follows.
05 BRANCH-NO               PIC S9(7) COMP-3.
05 ACCOUNT-NO              PIC S9(9) COMP-3.
05 LIM-LAST-CHG-YYDDD      PIC S9(5) COMP-3.
05 LIM-EXP-YYDDD           PIC S9(5) COMP-3.
05 FILLER                  PIC X(65).


My requirement is to extract records from the input file for which the expiry date is greater than 12 months from last changed date field.
Please let me know if any other details are requried.

Thanks
Prasanna G.
User avatar
Prasanna G
 
Posts: 68
Joined: Tue Apr 12, 2011 9:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Calculate the Julian date difference in input file

Postby skolusu » Wed Apr 24, 2013 9:56 pm

Prasanna G,

Use the following DFSORT JCL which will give you the desired results. YYDDD is Y2U format in packed decimal format with a length of 3 bytes.

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD DISP=SHR,DSN=Your Input FB 80 byte file
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  OPTION COPY                                       
  INREC OVERLAY=(81:10,3,Y2U,ADDMONS,+12,TOJUL=Y2U)
  OUTFIL INCLUDE=(13,3,Y2U,GT,81,3,Y2U),BUILD=(1,80)
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

These users thanked the author skolusu for the post:
Prasanna G (Fri Apr 26, 2013 1:26 pm)
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post