View previous topic :: View next topic
|
Author |
Message |
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
I have two files which I have to merge after adding the headers in both of them.
The files should be merged in such a way that data from 2nd file should always start from a new page.
Input File 1: 1st PART OF THE REPORT
Code: |
AAA 10
BBB 20
CCC 30 |
Input File 2: 2nd PART OF THE REPORT
Code: |
XXX 10
YYY 20
ZZZ 30 |
Final Report:
Code: |
CODE COUNT
AAA 10
BBB 20
CCC 30
<NEW PAGE>
ACCOUNT COUNT
XXX 10
YYY 20
ZZZ 30 |
2nd part of the report should start from new page. All files are LRECL =133 and FB. And eac page has 55 lines.
I'm able to add headers, but not sure how to push the 2nd file on next page. I'm using SYNCSORT FOR Z/OS 1.4.1.0R
Thanks. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Define the output file as LRECL =133 and FBA.
The A in FBA means the printer expects that the first of the 133 character is a control code (such as SPACE for a single space, 1 for new page and so on...).
Browse a SYSPRINT file in SDSF (easily found in compile jobs), then hit the PF10 key (hopefully assigned to LEFT), you will see the control character appear.
So maybe you just need that output:
Code: |
1CODE COUNT
AAA 10
BBB 20
CCC 30
1ACCOUNT COUNT
XXX 10
YYY 20
ZZZ 30 |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
the only problem that might emerge is that
the first page might not print correctly ...
it will probably have 56 lines ( 1 added line + the existing 55 ) |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Write two separate reports and use a stapler.
Write two separate reports to DSNs and concatenate those where you need them as one report.
Are the headings to repeat on each page? If so, that would be a problem doing it in one shot anyway. It could be arranged, but why complicate it? Why do they need to actually be together in one dataset (spool or otherwise)? |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Hi Bill,
So many questions?
|
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
title wrote: |
SYNCSORT - Pushing the data on next section. |
What do you mean by that? |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi All,
Thanks for your responses. Yesterday we had a holiday here in India. Sorry for replying late.
Quote: |
SYNCSORT - Pushing the data on next section. |
Sorry, that was a mistake. I meant on next page.
Quote: |
Why do they need to actually be together in one dataset (spool or otherwise)? |
It's the business requirement. Basically the reports are stored in a repositery and will be printed on a need to know basis.
Thanks for provinding the pointers. I will post the final solution once I got it working. |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Hi,
I used the method sugegsted by Marso. But they want balnk lines to be explicitily added till the next page.
So as Bill suggested, I created two SORT step. In first file no of records will always be fixed. Apart from adding HEADER1, I also added TRAILER1=n/, to insert required blank lines in order to move the data from 2nd file on next page.
Thanks again for your help. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The Repository may have/should have the ability to produce output of a "logical report" which consists of two (or more) "physical" reports.
If it can say "give me all the month-end reports" then it can say "give me the periodic-request-only-need-to-know-reports" which are defined as being your two reports. With or without wrappers produced by the Repository.
Hit the docs, ask the vendor. You may get lucky that way. If not, you may want to consider another Repository that can be easily customised:-) |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Hi Marso,
Sorry, I also was away.
Yes. If something can be dealt with by simply not doing anything, I want to know why someone wants to do something to do it.
Someone came to me with a similar requirement once. I went to the user. They received three reports daily. It was the first and third report they wanted to be joined together. I asked why. They said they never used the second report, so had to throw it away. If the first and third reports were joined together, they could just ignore the second report rather than throwing it away, because throwing it away is a waste :-)
We just took the second report off their distribution list. Then they rang up the following day to thank us for joining up the two reports so quickly.
We do get asked to do stupid things at times, but that doesn't mean we always have to stupidly do them :-) |
|
Back to top |
|
|
|