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

Delete some records in a file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
learnmf

Active User


Joined: 14 Mar 2005
Posts: 123

PostPosted: Sun Jul 17, 2005 10:38 pm
Reply with quote

Hi Friends

How can we delete some records of file using sort command.

Thanks
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 Jul 17, 2005 11:20 pm
Reply with quote

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
View user's profile Send private message
ankursanghi

New User


Joined: 19 Jul 2005
Posts: 4

PostPosted: Tue Jul 19, 2005 2:09 pm
Reply with quote

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
View user's profile Send private message
withnams

New User


Joined: 06 Jul 2005
Posts: 26
Location: Chennai

PostPosted: Tue Jul 19, 2005 2:41 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Jul 23, 2005 5:33 am
Reply with quote

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
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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top