Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Merge and sort two sequential dataset in one step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Merge and sort two sequential dataset in one step
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    Post subject:
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 Moderator


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

PostPosted: Fri Aug 10, 2007 8:14 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Aug 13, 2007 8:58 am    Post subject:
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 Moderator


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

PostPosted: Mon Aug 13, 2007 8:42 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us