Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

sort data on dddmmyy type.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Sat Nov 15, 2008 3:34 pm    Post subject: sort data on dddmmyy type.
Reply with quote

Dear techies

I have a sort requirement where in i have to include one condition which is like:
EX:
include cond=(1,4,PD,LE,131108)
the date format is ddmmyy and dd=13,mm=11,yy=08.
And the need is to get data which has this date field less than or equall to 13 Nov' 2008(131108).
ddmmyy is a packed decimal format with 4 bytes of usage.

But the above condition doesn't satisfy the need as dfsort is considering it as just a no. and not necessarily a date field.

I am aware that there are different formats like full format and year formats.And this comes in YR format.So i used this format and was able to get it done someway which took me to include two JCL sort cards but i hope there is a shortcut method for this.
I will appreciate your views on this.And let me know if you need more clarification.
Back to top
View user's profile Send private message

nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Sat Nov 15, 2008 11:34 pm    Post subject:
Reply with quote

Your requirement is not clear...
If you want all the records before 131108, u can use the same include condition as you mentioned...

If you need something else, show as with example of the input and ouput record. Give us RECFM and LRECL.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Sun Nov 16, 2008 12:36 am    Post subject: Reply to: sort data on dddmmyy type.
Reply with quote

the issue is that the date is not in the proper format for a straight numeric comparison

is stored as DDMMYY
instead of ( as the rest of the world does ) yymmdd
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Sun Nov 16, 2008 12:56 am    Post subject:
Reply with quote

Hi Nelson

The problem is the format 'ddmmyy' can't be compared with that include condition.As it considers that as a no which i have already mentioned.
so what happens is :

Ex: if you consider this (131108) as a no. then dates like '(01 to 12)1208'
will also show up.

There can be many such instances where the date can be in fact greater than 13 nov' 08 but it will appear with that condition.Hope that clears the confusion.

Please let me know if you need any more information.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Sun Nov 16, 2008 1:02 am    Post subject:
Reply with quote

DFSORT has Y2x formats that can handle mmddyy dates, but not ddmmyy dates so you need to be a bit trickier here.

Here's a DFSORT job that will do what you asked for. I assumed you only have 20yy dates, not 19yy and 20yy dates. I also assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(81:1,4,PD,TO=ZD,LENGTH=6,
    87:85,2,83,2,81,2)
  OUTFIL INCLUDE=(87,6,ZD,LE,081113),BUILD=(1,80)
/*
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Sun Nov 16, 2008 1:11 am    Post subject:
Reply with quote

Hi Frank


Thanks for the input. But i have some dates which refer to 19yy also.Is it possible to sort that out in same jcl.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Sun Nov 16, 2008 1:30 am    Post subject:
Reply with quote

Here's the DFSORT job for that. You'll need to set Y2PAST appropriately. I used Y2PAST=1990 which gives a century window of 1990-2089.

Code:

//S1    EXEC  PGM=ICEMAN                                           
//SYSOUT    DD  SYSOUT=*                                           
//SORTIN DD DSN=... input file (FB/80)                               
//SORTOUT DD DSN=...  output file (FB/80)   
//SYSIN    DD    *                                                 
  OPTION COPY,Y2PAST=1990                                         
  INREC OVERLAY=(81:1,4,PD,TO=ZD,LENGTH=6,                         
    87:85,2,83,2,81,2)                                             
  OUTFIL INCLUDE=(87,6,Y2T,LE,Y'081113'),BUILD=(1,80)       
/*       
Back to top
View user's profile Send private message
malayajena

New User


Joined: 08 Jul 2006
Posts: 28
Location: Singapore

PostPosted: Sun Nov 16, 2008 1:56 am    Post subject:
Reply with quote

Hi Frank

That is great, thank you very much.
You are really a good help to many of us.

Cheers.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us