Joined: 21 Nov 2008 Posts: 31 Location: United Kingdom
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.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
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:
Joined: 21 Nov 2008 Posts: 31 Location: United Kingdom
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 -