Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Delete some records in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Delete some records in a file
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 Moderator


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

PostPosted: Sun Jul 17, 2005 11:20 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat Jul 23, 2005 5:33 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us