Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us