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

Add Header/Trailer Record to file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Richard Galley

New User


Joined: 21 Nov 2008
Posts: 31
Location: United Kingdom

PostPosted: Wed Oct 06, 2010 7:43 pm
Reply with quote

Hi Guys

We run an extract that creates FileA. FileA is then split into FileB & FileC. FileB contains a max 3,900,000 recs. FileC will contain anything > 3,900,000. Even if FileC is empty(ie. extract file is < 3.9 mil) it still needs to be created with Header/Trailer from FileA. Any suggestions on how to do this appreciated.

FileA - VB,2000

Header record & 2 records

Code:
0OTR000003712A20100830225552OLRTRTROLR                                     
5201008301055395ZC9B-AET201008301055395C681896D3FDA894B0101HN201008300003078
5201008301055395ZC9B-AET201008301055395C681896D3FDA894B0102HN201008300003078


Trailer record & 2 records

Code:
5201008301832128UCCHPI0920100830183212800000000000000000100HN201008305010137 VE9
5201008301856140UCCHPI0920100830185614000000000000000000100HN201008305010137 VE9
9OTR000003712003585966
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: Wed Oct 06, 2010 10:31 pm
Reply with quote

It isn't clear what you're showing here - is it input or output - or what exactly you're trying to do. You need to do a better job of explaining what you want.

Please show an example of the records your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.

Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*
Back to top
View user's profile Send private message
Richard Galley

New User


Joined: 21 Nov 2008
Posts: 31
Location: United Kingdom

PostPosted: Thu Oct 07, 2010 1:21 pm
Reply with quote

I will try again. Extract runs & creates a file(FileA). FileA is then sorted & writes output to FileB upto max rec count of 3,900,000.
Code:
SORT FIELDS=COPY,STOPAFT=3900000

FileA is then sorted again & writes any output to FileC.
Code:
SORT FIELDS=COPY,SKIPREC=3900000

If rec count <3,900,000 there is not a problem the Header/Trailer record is copied to FileA. Problem occurs if rec count >3,900,000 because the Header record is written to FileB & trailer to FileC. What I require is that there is always a Header/Trailer in FileB & Header/Trailer in FileC, even if there is no data in FileC.

All files are VB, LRECL=2000

eg. Input FileA showing Header Record/4recs/Trailer Record -

Code:
0OTR000003712A20100830225552OLRTRTROLR
5201008301055395ZC9B-AET20100830105539
5201008301055395ZC9B-AET20100830105539
5201008301832128UCCHPI0920100830183212
5201008301856140UCCHPI0920100830185614
9OTR000003712003585966                                 


Output from job you requested running -
Code:
BLOCKSET     COPY  TECHNIQUE SELECTED                                         
VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE   
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 08:47 ON THU OCT 07, 2010
    OPTION COPY                                                               
RECORD TYPE IS F - DATA STARTS IN POSITION 1                                   
C5-K51706 C6-K51706 C7-K51706 C8-K51706 E9-K51706 C9-BASE   E5-K51706 E7-K51706
ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED             
TCSRGA01.S1      .        , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB         
MAIN STORAGE = (MAX,6291456,6278238)                                           
MAIN STORAGE ABOVE 16MB = (6200798,6200798)                                   
OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,V
OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,M
OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC
OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,STIMER=
OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0 
OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMD
OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZ
OPTIONS: NULLOUT=RC0                                                           
BSAM ACCESS METHOD USED FOR SORTOUT                                           
BSAM ACCESS METHOD USED FOR SORTIN                                             
EF-K49534 F0-K49037 E8-K51706                                                 
OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB                                     
INSERT 0, DELETE 0                                                             
RECORDS - IN: 1, OUT: 1                                                       
END OF DFSORT                                                                 
Back to top
View user's profile Send private message
Senthilkumar k
Warnings : 1

New User


Joined: 07 May 2009
Posts: 51
Location: Chennai

PostPosted: Thu Oct 07, 2010 2:57 pm
Reply with quote

Is your fileA contain duplicate records?
Back to top
View user's profile Send private message
Richard Galley

New User


Joined: 21 Nov 2008
Posts: 31
Location: United Kingdom

PostPosted: Thu Oct 07, 2010 3:10 pm
Reply with quote

No duplicates.
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 Oct 07, 2010 11:11 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT1) INPUT KEEP HEADER TRAILER -
  RRN(1,39000000)
SUBSET FROM(IN) TO(OUT2) INPUT KEEP HEADER TRAILER -
  RRN(39000001,*)
/*
Back to top
View user's profile Send private message
Richard Galley

New User


Joined: 21 Nov 2008
Posts: 31
Location: United Kingdom

PostPosted: Fri Oct 08, 2010 1:36 pm
Reply with quote

Hi Frank Spot-on resolution as usual. Works perfectly. Thanks.
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 How to split large record length file... DFSORT/ICETOOL 7
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top