Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us