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

delete 50 records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Dec 20, 2010 6:18 pm
Reply with quote

Hi,

I want to delete 50 records from a file that has 100,000 records. Can I achieve it using SORT if I give same file as input and output? Or, will there be any space abends from SORT side? Does sort allow several parameters to code in SYSIN card? What is the limit?

I am trying below sample SORT card but before attempting just need clarification.

Code:

//STEP0001 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=XXXXX.INPUT.FILE.XXX.XX1.XX2.XXX3,       
//            DISP=(SHR,KEEP,KEEP)                         
//SORTOUT  DD DSN=XXXXX.OUTPU.FILE.XXX.XX1.XX2.XXX3,       
//            DISP=(SHR,KEEP,KEEP)                         
//SYSIN    DD *                                           
 SORT FIELDS=COPY                                         
 OMIT COND=(1,2,CH,EQ,C'01',AND,10,6,CH,EQ,C'ABC123',AND, 
            16,4,CH,EQ,C'1010',AND,20,5,CH,EQ,C'10002')   
//*                                                       


As given above, I want to OMIT several (approx. 50 recs) records from input. How to code multiple ones?

Please help.

Thanks.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Dec 20, 2010 6:23 pm
Reply with quote

Did you try executing your code and also did you search the forum and did you tell your requrement properly?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Dec 20, 2010 6:23 pm
Reply with quote

I would suggest that you try it out anyway.

Looking at your code above, are the omit conditions linked or unique.
That is, do you want to omit on any condition stated, or does the record need to meet all of the criteria before being omitted.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Dec 20, 2010 7:06 pm
Reply with quote

It is for only one record. There are 50 such unique records to be omitted. I could execute it on one record successfully.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Dec 20, 2010 7:40 pm
Reply with quote

Depending on your criteria, maybe use nested parentheses?
Code:
 SORT FIELDS=COPY                                         
 OMIT COND=((1,2,CH,EQ,C'01',AND,10,6,CH,EQ,C'ABC123',AND, 
            16,4,CH,EQ,C'1010',AND,20,5,CH,EQ,C'10002'),OR,
                (1,2,CH,EQ,C'99',AND..........))

Garry.   
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Dec 29, 2010 11:17 pm
Reply with quote

ramsri wrote:
I want to delete 50 records from a file that has 100,000 records. Can I achieve it using SORT if I give same file as input and output?

For a COPY or MERGE, the output file must not be the same as any of the input files. That being said, as Garry pointed out, your data sets are not named the same in your example, so this is a moot point.

Regards,
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top