View previous topic :: View next topic
|
Author |
Message |
lowie82ph
New User
Joined: 07 Mar 2005 Posts: 4
|
|
|
|
hi,
is it possible to merge and sort two sequential dataset in one step?
if it is possible, kindly give example.
thanks. |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Hi,
Concatenate your datasets in a single DD name and sort on it.
--Parag |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
is it possible to merge and sort two sequential dataset in one step?
if it is possible, kindly give example. |
Kindly give an example and better explanation of what it is you want to do. |
|
Back to top |
|
|
lowie82ph
New User
Joined: 07 Mar 2005 Posts: 4
|
|
|
|
The requirement is to SORT two datasets and then make the output to one dataset. This is what I did, I haven't executed it yet:
Code: |
//STEP15 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XXXXX.DATASET1,DISP=SHR
// DD DSN=XXXXX.DATASET2,DISP=SHR
//SORTOUT DD DSN=XXXXX.DATASET.SORT,
// DISP=(,CATLG,DELETE),...
//SYSIN DD *
SORT FIELDS=(117,3,A),FORMAT=PD
//*
|
Will this work? Please give me the correct code if that is wrong, thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If both of your data files have the same dcb attributes, there is a 3-byte packed decimal (comp-3) field beginning at pos 117, and the files are FB this:
Code: |
SORT FIELDS=(117,3,A),FORMAT=PD
|
should work |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
lowie82ph,
Providing you have have a 3-byte PD field in input positions 117-119, it will work if both input files have RECFM=VB, or if both input files have RECFM=FB and the same LRECL. Note that for variable records, there's an RDW in positions 1-4 so the first data byte starts at position 5. This is important when determining the correct starting position of the SORT field.
Is there some reason why you couldn't have just tried it to see if it worked?
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|