Join Vs Concatenation on VSAM datasets



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Join Vs Concatenation on VSAM datasets

Postby Shakthi_Priya_R » Thu Jun 06, 2013 5:41 pm

Hi,

Can anybody please calrify me.

How is that VSAM datasets are allowed sorting during JOINKEYS operation, but SORT FIELDS=COPY does not work for concatenation?

(Though MERGE FIELDS option and MULTIIN facility allows the concatenation)?

Hoping I made my doubt clear, thanks in advance.
Shakthi_Priya_R
 
Posts: 5
Joined: Tue Feb 14, 2012 3:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Join Vs Concatenation on VSAM datasets

Postby dick scherrer » Thu Jun 06, 2013 7:16 pm

Hello and welcome to the forum,

How is that VSAM datasets are allowed sorting during JOINKEYS operation, but SORT FIELDS=COPY does not work for concatenation?
Not making fun, but this is like asking why the steering wheel on your vehicle cannot be used as a spare tire . . . They are unrelated.

JOINKEYS provides the ability to sort data if needed. COPY does just that - it copies data.

VSAM files do not concatenate as far as know.

Suggest you explain what you have (with some sample input data) and what you want your process to do with this data (show the desired output when the sample data is processed. Also, mention the recfm and larecl(s).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Join Vs Concatenation on VSAM datasets

Postby Shakthi_Priya_R » Thu Jun 06, 2013 7:39 pm

Hi Dick,
Good Morning.
According to the SYNCSORT FOR Z/OS 1.4.1,
The following piece of code concatenates the three input files(VSAM+non VSAM files).


//STEP1 EXEC PGM=SYNCSORT,PARM=MULTIIN               
//SYSPRINT DD SYSOUT=*                               
//SYSOUT   DD SYSOUT=*                               
//SORTMI1 DD DSN=INPUT1,DISP=SHR          * VSAM     
//SORTMI2 DD DSN=INPUT2,DISP=SHR          * VSAM     
//SORTMI3 DD DSN=INPUT3,DISP=SHR          * Flat file
//SORTOUT  DD DSN=OUTPUT1,                           
//             DISP=(NEW,CATLG,DELETE),               
//             .....                                 
//SYSIN DD *                                         
   SORT FIELDS=(1,12,CH,A)                                   
/*                                                   


Which, with just a sort with inputs defined by SORTIN without the use of MULTIIN parm would have thrown me the following error:
WER254A  SORTIN   VSAM OPEN ERROR  -- BC


I am just intrigued to know why this cannot be accomplised by just SORT FIELDS statement (not just SORT FIELDS=COPY), as JOINKEYS also does some kind of sorting.

Thanks
Shakthi_Priya_R
 
Posts: 5
Joined: Tue Feb 14, 2012 3:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Join Vs Concatenation on VSAM datasets

Postby dick scherrer » Thu Jun 06, 2013 7:56 pm

Hello,

In the posted step, there is No SORTIN DD statement . . .

There is also no concatenation specified. Are you familiar with concatenation?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Join Vs Concatenation on VSAM datasets

Postby Shakthi_Priya_R » Thu Jun 06, 2013 8:04 pm

Hi,
SORTMInn replaces the SORTIN DD which is the whole point here. MULTIIN parm along with SORTMInn is what facilitates the concatenation(or appending) here. I get all the records from all the 3 inputs into the output.

My doubt is that if SORT FIELDS with SORTIN DD does not work on VSAM datasets, JOINKEYS should not work on VSAM datasets as well, as it sorts data. Do I make sense? I am sorry, if not!

Thanks
Shakthi_Priya_R
 
Posts: 5
Joined: Tue Feb 14, 2012 3:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Join Vs Concatenation on VSAM datasets

Postby Shakthi_Priya_R » Thu Jun 06, 2013 8:07 pm

Or is it like, in JOINKEYS the records are joined and VSAM datasets no more come into the picture after join is done and sort is done after that?
Shakthi_Priya_R
 
Posts: 5
Joined: Tue Feb 14, 2012 3:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Join Vs Concatenation on VSAM datasets

Postby Akatsukami » Thu Jun 06, 2013 8:13 pm

It may be that Priya-chan and you are talking at cross-purposes, Dick.

She seems to be claiming that Syncsort can be given a MULTIIN parameter which causes it to use SORTMIn DD statements, with one data set per statement, instead of a single SORTIN with concatenated data sets, and wonders why this cannot simply be done by concatenating the data sets.

The reason is, Priya-chan, as Mr. Scherrer says: you cannot concatenate VSAM data sets. Syncsort is here doing a sort of "pseudo-concatention" in which data sets are dynamically allocated and read beginning-to-end individually; the accumulated records are stored in a temporary PS data set and treated as such.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Join Vs Concatenation on VSAM datasets

Postby dick scherrer » Thu Jun 06, 2013 9:03 pm

Hello,

It may be that Priya-chan and you are talking at cross-purposes, Dick.

Yup - my bad. I got too hung up on "concatenation" . . . :oops:

My doubt is that if SORT FIELDS with SORTIN DD does not work on VSAM datasets,

SORT FIELDS Does work with VSAM datasets . . . We use this a LOT, but have not needed the MULTIIN feature (yet?).

It will probably help if you post the complete diagnostic / informational messages generated by the problem run.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Join Vs Concatenation on VSAM datasets

Postby Shakthi_Priya_R » Fri Jun 07, 2013 10:56 am

Hi..
She seems to be claiming that Syncsort can be given a MULTIIN parameter which causes it to use SORTMIn DD statements, with one data set per statement, instead of a single SORTIN with concatenated data sets, and wonders why this cannot simply be done by concatenating the data sets.

You are right.. I was just wondering why the below JCL which appends the input flat files would not work for VSAM input files.
//STEP1 EXEC PGM=SORT             
//SYSPRINT DD SYSOUT=*           
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD DSN=INPUT1,DISP=SHR
//         DD DSN=INPUT2,DISP=SHR
//SORTOUT  DD SYSOUT=*           
//SYSIN DD *                     
   SORT FIELDS=(1,4,CH,A)               
/*                               

SORT FIELDS Does work with VSAM datasets . . . We use this a LOT, but have not needed the MULTIIN feature (yet?).

I agree. SORT FIELDS does sort a VSAM file. I was just curious why the concatenation aided by SORT does not work on VSAM files.
Ok.. So finally, VSAM files cannot be concatenated using SORT. :)

Thanks Dick and Akatsukami. :)
Shakthi_Priya_R
 
Posts: 5
Joined: Tue Feb 14, 2012 3:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Join Vs Concatenation on VSAM datasets

Postby BillyBoyo » Fri Jun 07, 2013 11:53 am

Generally, VSAM files cannot be concatenated by anything. You may find products which have been coded very deliberately to allow this, like SAS, but unless the documentation for a product specfically says you can do it, you can't.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post