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 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 4 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