IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ICETOOL - Date format DB2 (DD.MM.YYYY)


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jackare

New User


Joined: 27 Aug 2008
Posts: 35
Location: Brazil

PostPosted: Thu Aug 28, 2008 8:26 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 28, 2008 10:34 am
Reply with quote

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
View user's profile Send private message
jackare

New User


Joined: 27 Aug 2008
Posts: 35
Location: Brazil

PostPosted: Thu Aug 28, 2008 5:24 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Aug 28, 2008 6:22 pm
Reply with quote

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
View user's profile Send private message
jackare

New User


Joined: 27 Aug 2008
Posts: 35
Location: Brazil

PostPosted: Thu Aug 28, 2008 8:40 pm
Reply with quote

Ok! Thanks a lot! I gonna try this. However, is there another way using "DATE? format"as I saw in the topic ibmmainframes.com/viewtopic.php?t=32000.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Aug 28, 2008 10:01 pm
Reply with quote

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
View user's profile Send private message
jackare

New User


Joined: 27 Aug 2008
Posts: 35
Location: Brazil

PostPosted: Fri Aug 29, 2008 12:20 am
Reply with quote

OK! Thanks a lot!
I going to use the arcvns's tip.
Thanks Frank !
Thanks arcvns!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top