MIN and MAX Date



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

MIN and MAX Date

Postby Fly Simply » Wed Jan 09, 2013 10:23 am

Hi Everyone,

I have a dataset in which the dates are in PD format (Col 19). What I am trying to achieve is. I want to get the MIN and MAX Date from huge dataset. I created a JCL with which I was able to achieve this.

//**********************************************************************
//*GET MAX AND MIN FOR DATE         
//**********************************************************************
//STEP1    EXEC PGM=SORT,REGION=0M                                     
//SORTIN   DD   DISP=SHR,DSN=TEST.INPUT                 
//SORTOUT  DD   SYSOUT=*                                               
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN DD *                                                           
  SORT FIELDS=(19,4,CH,A)                                               
  OUTFIL NODETAIL,REMOVECC,                                             
      TRAILER2=('DATE: ',                       
        MIN=(19,4,PD,TO=ZD),' - ',MAX=(19,4,PD,TO=ZD))                 


The output of this JCL is in Format:
DATE: 2012044 - 2012296
Date Format: CCYYDDD (Julian Date)

I have been looking over various forums but could not find a way to convert this julian date to Gregorian Date Format (MM/DD/CCYYY)
Is there a way to further tweak parameters of MIN/MAX to reformat the dates. I know another way to convert the date, but I am not sure how they can be integrated in one.

INREC BUILD=(19,4,Y4T,TOGREG=Y2T)


Please pour in your suggestions and point out, if my approach is incorrect.

Thanks. :)
Fly Simply
 
Posts: 2
Joined: Thu May 31, 2012 3:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: MIN and MAX Date

Postby enrico-sorichetti » Wed Jan 09, 2013 1:04 pm

see here
ftp://ftp.software.ibm.com/storage/dfso ... rttrck.pdf

IIRC the right format should be something like
Y2U,TOGREG=Y4W(/)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: MIN and MAX Date

Postby Fly Simply » Wed Jan 09, 2013 10:53 pm

Enrico, Thanks for your response. But can the parameters mentioned above be used with MAX/MIN functions ?
Fly Simply
 
Posts: 2
Joined: Thu May 31, 2012 3:59 am
Has thanked: 0 time
Been thanked: 0 time

Re: MIN and MAX Date

Postby skolusu » Wed Jan 09, 2013 11:39 pm

Fly Simply wrote:Enrico, Thanks for your response. But can the parameters mentioned above be used with MAX/MIN functions ?


Fly simply,

Date conversion functions are not available with Reporting features. Use the following DFSORT JCL which will give you the desired results. Based on offline discussion about RECFM and other details.
//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DISP=SHR,DSN=Your input VB file
//SORTOUT  DD DSN=&&FB,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)     
//SYSIN    DD *                                               
  OPTION COPY                                                 
  INREC BUILD=(1,4,19,4)                                       
  OUTFIL VTOF,REMOVECC,NODETAIL,BUILD=(80X),                   
  TRAILER1=('DATE: ',MIN=(5,4,PD,M11,LENGTH=7),4X,'- ',       
                     MAX=(5,4,PD,M11,LENGTH=7))               
//*                                                           
//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=&&FB,DISP=SHR                               
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  OPTION COPY                                                 
  INREC OVERLAY=(7:7,7,Y4T,DT=(MD4/),20:20,7,Y4T,DT=(MD4/))   
//*             
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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