View previous topic :: View next topic
|
Author |
Message |
shan
New User
Joined: 10 Aug 2006 Posts: 7
|
|
|
|
i have 4 files as input and need to write it to two files as below, please let me know whether it can be done by SORT in a single step.
Input File 1 (F1)
1111
1111
Input File 2 (F2)
2222
2222
Input File 3 (F3)
3333
3333
Input File 4 (F4)
4444
4444
Output File1 (concatenation of first two input files, F1 and F2)
1111
1111
2222
2222
Output File2 (concatenation of last two input files, F3 and F4)
3333
3333
4444
4444 |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, you're going to have to explain this.
Why does it have to be in one step?
Yes, it can be done, just wondering why you want to bother with it in one step, rather than two, which goes like this:
Code: |
//SORTIN DD your necessary details dataset a
// DD your necessary details dataset b
//SORTOUT DD your necessary output details
//SYSIN DD *
OPTION COPY |
That, along with the "usual stuff", will copy your two input datasets to one output. Put it in a PROC. Run the PROC twice with different input/output datasets.
Also note, without having headers and trailers, you can just "concatenate" wherever the data is needed, without having to have it as one dataset. Might be worth considering, especially for very large amounts of data. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It can be done in a single step using ICETOOL, but why the need for a single step ? |
|
Back to top |
|
|
Gary McDowell
Active User
Joined: 15 Oct 2012 Posts: 139 Location: USA
|
|
|
|
Quote: |
Why does it have to be in one step? |
Quote: |
It can be done in a single step using ICETOOL, but why the need for a single step ? |
The original requestor was asking can it be done in a single step
and not that it has to be done in a single step. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Ah...., didn't realise it was just an idle question with a Yes/No answer.
Yes.
As expat points out, it can also be done in ICETOOL in one step.
It is far more sensible to do it in no steps, or two steps, (until we know otherwise as a non-"idle question") but there you go. |
|
Back to top |
|
|
|