Page 1 of 1

Concatenation problem

PostPosted: Mon Feb 16, 2009 5:53 pm
by jpm4
Hi,

I've only a v basic level of JCL......hoping someone can help out on this problem:


A standard piece of JCL in one of our jobs would be:

//SYSIN DD DSN=EW.REF.CONTROL.LOGON(SC2LOGON),
// DISP=SHR
// DD DSN=SU.REF.CONTROL.DML(SQCUCL15),
// DISP=SHR
// DD DSN=EW.REF.CONTROL.DML(SQQUIT0),
// DISP=SHR


Logon, run a a piece of SQL, logoff. As I understand how concatenation of datasets works, all datasets must be of the same LRECL for this to work, which is fine in most cases. However we now have a requirement to execute SQL that has been dymanicly generated into a dataset, like this:


//SYSIN DD DSN=EW.REF.CONTROL.LOGON(SC2LOGON),
// DISP=SHR
// DD DSN=SU.REF.CONTROL.DYNAMICSQL,
// DISP=SHR
// DD DSN=EW.REF.CONTROL.DML(SQQUIT0),
// DISP=SHR

The problem is that since we don't know how long the SQL string will be in advance, we need to specify a 'safe' upper limit on the LRECL of SU.REF.CONTROL.DYNAMICSQL when it is created, which means that when it comes to executing the above JCL a concatenation abend is thrown, as the LRECL of SU.REF.CONTROL.DYNAMICSQL does not match the other datasets.

Can anyone think of a way around this? (Aside from setting the value of LRECL to the 'safe' limit for all datasets involved, which presumably would work but is not a practical solution in this case).

Many Thanks,
John

Re: Concatenation problem

PostPosted: Mon Feb 16, 2009 10:34 pm
by dick scherrer
Hello John and welcome to the forum,

Rather than change the existing datasets, you might copy the individual members (at runtime) to a couple of temporary files that would be defined at the "safe" length and discarded when the query ended. Your concatenation would all be at the safe length and the original datasets would remain unchanged.