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
 

 

Reducing the number of records in a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Fri Jan 16, 2009 4:03 pm    Post subject: Reducing the number of records in a file
Reply with quote

Hi,

I have a file with 30K records. I want to copy only 15K records out of it to a new file.
Could you please help what will be the easiest way to achieve this.

Thanks
Nirmal
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jan 16, 2009 4:13 pm    Post subject:
Reply with quote

IDCAMS REPRO can do it, SORT can do it.

Both sets of manuals are available from the "IBM manuals" button at the top of the page.
Back to top
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Fri Jan 16, 2009 4:19 pm    Post subject: Reply to: Reducing the number of records in a file
Reply with quote

Code:

//STEP01   EXEC SORTD5                               
//SYSOUT   DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SORTIN   DD  DSN=USERID.FILE,DISP=SHR             
//SORTOF1  DD  DSN=USERID.SPLIT1,                   
//             DISP=(NEW,CATLG,DELETE),             
//             UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
//             DCB=(*.SORTIN)                       
//SORTOF2  DD  DSN=USERID.SPLIT2,                   
//             DISP=(NEW,CATLG,DELETE),             
//             UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
//             DCB=(*.SORTIN)                       
//SYSIN    DD  *                                     
 SORT FIELDS=COPY                                   
 OUTFIL FILES=(1,2),SPLIT                           
 END                                                 
/*                                                   
//*                                                 

This will work..
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Fri Jan 16, 2009 4:29 pm    Post subject:
Reply with quote

Actually the count of record in input may vary and i want to restrict it to particular count in the output file.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Jan 16, 2009 4:33 pm    Post subject:
Reply with quote

Which is why I suggested IDCAMS REPRO using the COUNT parameter or you could use SORT with the STOPAFT statement
(Works for DFSORT, can not say for SYNCSORT).
Back to top
View user's profile Send private message
technut

New User


Joined: 27 Dec 2007
Posts: 73
Location: India

PostPosted: Fri Jan 16, 2009 4:36 pm    Post subject: Reply to: Reducing the number of records in a file
Reply with quote

Try this...
Code:


//STEP01  EXEC SORT                     
//SORTIN   DD DSN=USERID.FILE,           
//            DISP=SHR                   
//SORTOUT DD  DSN=USERID.FILE.OP,       
//            DISP=(NEW,CATLG,DELETE),   
//            SPACE=(CYL,(100,100),RLSE),
//            DCB=*.SORTIN               
//SYSIN    DD  *                         
  SORT FIELDS=COPY,                     
  STOPAFT=100000                         
/*                                       
//*       
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Fri Jan 16, 2009 4:44 pm    Post subject:
Reply with quote

Thanks a lot.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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