View previous topic :: View next topic
|
Author |
Message |
jackare
New User
Joined: 27 Aug 2008 Posts: 35 Location: Brazil
|
|
|
|
Hello,
I need some help here. My Dataset is a UNLOAD (Table DB2), then I need a way to sort this file by field in date format (DD.MM.YYYY) and excluding dates less than "22.07.2008". Is there a way to use ICETOOL or SORT without INREC/OUTREC, just using OMIT or INCLUDE option?
Sorry, my English isn't good! |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Carlos,
Can you post here the following.
1 . Sample input and output records
2 . LRECL/RECFM of your input and output files, positions of relevant fields
Thanks,
Arun |
|
Back to top |
|
|
jackare
New User
Joined: 27 Aug 2008 Posts: 35 Location: Brazil
|
|
|
|
arcvns wrote: |
Carlos,
Can you post here the following.
1 . Sample input and output records
2 . LRECL/RECFM of your input and output files, positions of relevant fields
Thanks,
Arun |
Ok.. It is:
The input file is:
03.03.2008RIBEIRAO
03.03.2008RIBEIRAO
30.04.2008GUATAPARA
30.04.2008GUATAPARA
01.04.2008ITAPUI
03.04.2008JAU
03.04.2008SALES OLIVEIRA
20.05.2008GUATAPARA
13.05.2008JAU
30.07.2008GUATAPARA
30.07.2008GUATAPARA
30.07.2008GUATAPARA
21.08.2008GUATAPARA
13.08.2008MINEIROS
Position from 01 to 10 - field "date of generation" - format DD.MM.YYYY
Position from 11 to 25 - field "City" - format char(15)
LRECL is 25 e RECFM is FB |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Carlos,
Here's a SORT job which would serve your requirement.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
03.03.2008RIBEIRAO
03.03.2008RIBEIRAO
30.04.2008GUATAPARA
30.04.2008GUATAPARA
01.04.2008ITAPUI
03.04.2008JAU
03.04.2008SALES OLIVEIRA
20.05.2008GUATAPARA
13.05.2008JAU
30.07.2008GUATAPARA
30.07.2008GUATAPARA
30.07.2008GUATAPARA
21.08.2008GUATAPARA
13.08.2008MINEIROS
//SYSIN DD *
INREC OVERLAY=(26:7,4,4,2,1,2)
SORT FIELDS=(26,8,ZD,A)
OUTFIL OMIT=(26,8,ZD,LT,20080722),BUILD=(1,25)
/* |
SORTOUT
Code: |
30.07.2008GUATAPARA
30.07.2008GUATAPARA
30.07.2008GUATAPARA
13.08.2008MINEIROS
21.08.2008GUATAPARA |
Thanks,
Arun |
|
Back to top |
|
|
jackare
New User
Joined: 27 Aug 2008 Posts: 35 Location: Brazil
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Is there a way to use ICETOOL or SORT without INREC/OUTREC, just using OMIT or INCLUDE option? |
No, because the DD.MM.YYYY format of your date cannot be collated correctly without transforming it to YYYYMMDD. If your date was in a form that could be collated correctly without transforming (such as YYYY.MM.DD) then you could use INCLUDE or OMIT directly.
Quote: |
However, is there another way using "DATE? format" |
I assume you mean DATEn (e.g. DATE1). DATEn is used for the current date in various forms (or a date relative to the current date such as DATE1-30). Since you said you want to use a specific date of "22.07.2008", DATEn isn't relevant. If you want to use the current date, then you could use OMIT with an appropriate form of DATEn vs the transformed date. |
|
Back to top |
|
|
jackare
New User
Joined: 27 Aug 2008 Posts: 35 Location: Brazil
|
|
|
|
OK! Thanks a lot!
I going to use the arcvns's tip.
Thanks Frank !
Thanks arcvns! |
|
Back to top |
|
|
|