View previous topic :: View next topic
|
Author |
Message |
learnmf
Active User
Joined: 14 Mar 2005 Posts: 123
|
|
|
|
Hi Friends
How can we delete some records of file using sort command.
Thanks |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can delete records from a file in various ways using DFSORT. For example, you can use the OMIT statement, the SKIPREC, STOPAFT, STARTREC, ENDREC or SAMPLE parameters, etc. If you want a more specific answer, you need to give more details on what exactly you want to do. |
|
Back to top |
|
|
ankursanghi
New User
Joined: 19 Jul 2005 Posts: 4
|
|
|
|
Hi Frank,
Here is one requirement that i need to address by deleting some records from a flat file:
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 |
|
|
withnams
New User
Joined: 06 Jul 2005 Posts: 26 Location: Chennai
|
|
|
|
in FILEAID go to 3.3 option in the selection ctriteria put T it leads to 3 options..u can go for 3rd option specify the postion and length of the field .
in the value part give LE AND GE and give the values...
once you are in 3.3 option you can do the required thing... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT INCLUDE statement to do that. Let's say your dates are ZD fields in the format yyyymmdd. date1 starts in position 11 and date2 starts in position 31. You could use a DFSORT job like the following:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INCLUDE COND=(11,8,ZD,LT,31,8,ZD)
/*
|
If you need something more specific, you have to supply more details such as the form of the dates and their starting positions. |
|
Back to top |
|
|
|