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

Copy Header and Trailer with only first 1000 detail records


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Aug 14, 2008 9:20 pm
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:

Use [URL] BBCode for External Links

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top