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
 
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: 8657
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: 8657
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 IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts VSAM File free space sancraig16 JCL & VSAM 13 Fri Mar 30, 2018 1:02 am

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