|
View previous topic :: View next topic
|
| Author |
Message |
ankursanghi
New User

Joined: 19 Jul 2005 Posts: 4
|
|
|
|
Hi all,
I am new to this forum. So, please guide me if I am making any mistakes in posting this query here.
Here is my problem:
The input flat file contains two date fields (both in display format).
My requirement is to filter the flat file such that the output file contains only records where first date is less than second date.
Is it possible to do it using SORT? Otherwise please suggest any other way like using Compare tool or File Aid... I need this asap... please help. |
|
| Back to top |
|
 |
KAUSHIK RANGARAJAN
New User

Joined: 19 Jul 2005 Posts: 22 Location: chennai
|
|
|
|
HI,
This might help.
Here is the code.
SORT FIELDS=(1,4,CH,A)
INCLUDE COND=(25,10,CH,LT,55,10,CH)
1,4 is primary key based on which sorting is done. This U will be knowing.
Now for that compare condition:
25,10 is the first date location. 55,10 is the second location.
CH is the format.
LT will check for the difference in dates, only those matching the condition will be selected.
Bye.
 |
|
| Back to top |
|
 |
pushpagiri
New User
.jpg)
Joined: 07 Jul 2005 Posts: 51
|
|
|
|
hi,
This wil work.Try it And let me know if i am
wrong anywhere.
input.ps:
20050716 20050718
20050716 20050719
20050716 20050714
20050716 20050715
jcl:
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=input.PS,DISP=SHR
//SORTOUT DD DSN=output.PS,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,8,CH,A)
INCLUDE COND=(1,8,CH,LE,10,8,CH)
/*
Regards,
Push |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You don't need to do a SORT to do this - you can just do a COPY. And LT (less than) is the correct comparison operator for the stated requirement, not LE (less than or equal to). The DFSORT job would be:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,8,CH,LT,10,8,CH)
/*
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|