Concatenation problem



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Concatenation problem

Postby jpm4 » Mon Feb 16, 2009 5:53 pm

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
jpm4
 
Posts: 3
Joined: Mon Feb 16, 2009 5:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Concatenation problem

 

Re: Concatenation problem

Postby dick scherrer » Mon Feb 16, 2009 10:34 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post