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

Reducing the number of records in a file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Jan 16, 2009 4:13 pm
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
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
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: 8797
Location: Welsh Wales

PostPosted: Fri Jan 16, 2009 4:33 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top