View previous topic :: View next topic
|
Author |
Message |
malayajena
New User
Joined: 08 Jul 2006 Posts: 28 Location: Singapore
|
|
|
|
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 |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
malayajena
New User
Joined: 08 Jul 2006 Posts: 28 Location: Singapore
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
malayajena
New User
Joined: 08 Jul 2006 Posts: 28 Location: Singapore
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
malayajena
New User
Joined: 08 Jul 2006 Posts: 28 Location: Singapore
|
|
|
|
Hi Frank
That is great, thank you very much.
You are really a good help to many of us.
Cheers. |
|
Back to top |
|
|
|