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

sort data on dddmmyy type.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sun Nov 16, 2008 12:36 am
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
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 Developer


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

PostPosted: Sun Nov 16, 2008 1:02 am
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
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 Developer


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

PostPosted: Sun Nov 16, 2008 1:30 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top