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

Merge and sort two sequential dataset in one step


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

New User


Joined: 07 Mar 2005
Posts: 4

PostPosted: Fri Aug 10, 2007 3:45 pm
Reply with quote

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
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Fri Aug 10, 2007 4:45 pm
Reply with quote

Hi,
Concatenate your datasets in a single DD name and sort on it.

--Parag
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: Fri Aug 10, 2007 8:14 pm
Reply with quote

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
View user's profile Send private message
lowie82ph

New User


Joined: 07 Mar 2005
Posts: 4

PostPosted: Mon Aug 13, 2007 8:42 am
Reply with quote

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. icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 13, 2007 8:58 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 13, 2007 8:42 pm
Reply with quote

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
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top