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
 

 

Copy Header and Trailer with only first 1000 detail records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mubashshirji

New User


Joined: 14 Nov 2006
Posts: 16

PostPosted: Thu Aug 14, 2008 3:32 pm    Post subject: Copy Header and Trailer with only first 1000 detail records
Reply with quote

I have the following requirement:

Copy Header and Trailer from the input VSAM file to the output VSAM file
with only first 1000 detail records.

header with first 3 record characters 0
trailer with first 3 record characters 9
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Aug 14, 2008 9:20 pm    Post subject:
Reply with quote

You can do this quite easily with the new SUBSET operator available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (VSAM)
//OUT DD DSN=...  output file (VSAM)
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) KEEP INPUT RRN(1,1001) TRAILER VSAMTYPE(V)
/*


For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

If you don't have PTF UK90013, ask your System Programmer to install it.

Alternatively, you can use a DFSORT job like this:

Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VSAM)
//SORTOUT DD DSN=...  output file (VSAM)
//SYSIN    DD    *
  OPTION COPY
  RECORD TYPE=V
  INREC BUILD=(1,4,5:SEQNUM,8,ZD,13:5)
  OUTFIL INCLUDE=(5,8,ZD,LE,+1001,OR,13,3,CH,EQ,C'999'),
    BUILD=(1,4,5:13)
/*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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