HELP REQUIRED in ICETOOL/DFSORT



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

HELP REQUIRED in ICETOOL/DFSORT

Postby sultanabdulkadhar » Tue Aug 18, 2009 10:43 pm

Hi,

Greetings!!!.

I need another help.

Is there any way to check the current system date in SORT/ICETOOL ?. let say current system date is 08-18-2009.

The date format is MM/DD/YYYY

Need to move the records which are greater than 7 days old compare with current system date to outputfile1
Need to move the records which are lessthan/equal to 7 days compare with current system date to outputfile2

Example

Input file

AAAAA07-31-2009XXXX
BBBBBB08-01-2009XXXX
CCCCC08-02-2009XXXX
EEEEEE08-11-2009XXXX
FFFFFF08-12-2009XXXX
GGGGG08-13-2009XXXX
HHHHH08-14-2009XXXX

outputfile1
AAAAA07-31-2009XXXX
BBBBBB08-01-2009XXXX
CCCCC08-02-2009XXXX
EEEEEE08-11-2009XXXX

Outputfile2
FFFFFF08-12-2009XXXX
GGGGG08-13-2009XXXX
HHHHH08-14-2009XXXX


hope you understand my query.. Please advice..

Thanks,
Sultan
sultanabdulkadhar
 
Posts: 19
Joined: Tue Jul 07, 2009 9:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: HELP REQUIRED in ICETOOL/DFSORT

Postby Frank Yaeger » Tue Aug 18, 2009 11:09 pm

You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

//S1    EXEC  PGM=SORT                                             
//SYSOUT    DD  SYSOUT=*                                           
//SORTIN DD *                                                     
AAAAA 07-31-2009XXXX                                               
BBBBBB08-01-2009XXXX                                               
CCCCC 08-02-2009XXXX                                               
EEEEEE08-11-2009XXXX                                               
FFFFFF08-12-2009XXXX                                               
GGGGG 08-13-2009XXXX                                               
HHHHH 08-14-2009XXXX                                               
//OUT1 DD SYSOUT=*                                                 
//OUT2 DD SYSOUT=*                                                 
//SYSIN    DD    *                                                 
  OPTION COPY                                                     
  INREC OVERLAY=(81:13,4,7,2,10,2)                                 
  OUTFIL FNAMES=OUT1,INCLUDE=(81,8,CH,LE,DATE1-7),BUILD=(1,80)     
  OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,80)                             
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: HELP REQUIRED in ICETOOL/DFSORT

Postby sultanabdulkadhar » Tue Aug 18, 2009 11:34 pm

Hi,

Need some clarification on this.

//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:13,4,7,2,10,2) - This is for formatting the the date MM/DD/YYYY to YYYYMMDD.
OUTFIL FNAMES=OUT1,INCLUDE=(81,8,CH,LE,DATE1-7),BUILD=(1,80) - Less than equal to 7 days will be moved into OUT1. Should i give DATE1 ?.
OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,80) - i am not sure what SAVE do here ?. how Greater than 7 days records to move here ?.

Please clarify.

Thanks,
Sultan
sultanabdulkadhar
 
Posts: 19
Joined: Tue Jul 07, 2009 9:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: HELP REQUIRED in ICETOOL/DFSORT

Postby Frank Yaeger » Wed Aug 19, 2009 1:04 am

Th[size=85][size=85][size=85][size=85][/size][/size][/size][/size]is is for formatting the the date MM/DD/YYYY to YYYYMMDD.


Yes.

Less than equal to 7 days will be moved into OUT1. Should i give DATE1 ?


I don't understand what you're asking. INCLUDE=(81,8,CH,LE,DATE1-7) says to keep the records in which the yyyymmdd date in 81-88 is less than or equal to todays date minus 7 days in yyyymmdd format. That's what you said you wanted. What do you mean by "should I give DATE1"? DATE1 is the current date. DATE1-7 is the current date minus 7 days.

i am not sure what SAVE do here ?. how Greater than 7 days records to move here ?


SAVE keeps the records that were NOT kept by the INCLUDE, so those would be the records in which the yyyymmdd date in 81-88 is greater than todays date minus 7 days in yyyymmdd format. That's what you said you wanted.

The job I gave you creates the output you wanted from the input you showed. Did you try it?

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: HELP REQUIRED in ICETOOL/DFSORT

Postby sultanabdulkadhar » Fri Aug 21, 2009 11:31 pm

Hi,

Thanks a lot. Its working Great....
sultanabdulkadhar
 
Posts: 19
Joined: Tue Jul 07, 2009 9:33 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post