Skip to main content

I am looking for sample JCL to specify connecting to an XA resource that is pointed to SQL Server which uses EXEC PGM=program vs EXEC PGM=IKJEFT01...

Can this be done?  Would it be using SYSTSIN?

Thanks



------------------------------
Bruce Cheatwood
BWXT
Lynchburg VA US
------------------------------

I am looking for sample JCL to specify connecting to an XA resource that is pointed to SQL Server which uses EXEC PGM=program vs EXEC PGM=IKJEFT01...

Can this be done?  Would it be using SYSTSIN?

Thanks



------------------------------
Bruce Cheatwood
BWXT
Lynchburg VA US
------------------------------

Hi Bruce,

I have not tested the EXEC PGM=program approach, but depending on your requirement you could use DSN SYSTEM, see example JCL below (TEST is the XA Resource manager name, DSNTEP2 can be used to run dynamic SQL statement embedded in the jcl):

//DDLJOB2 JOB 
//RESETDB  EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSPUNCH DD  SYSOUT=*                                
//SYSUDUMP DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SYSTSIN  DD  *
 DSN SYSTEM(TEST)
 RUN  PROGRAM(DSNTEP2)
 END
/*
//SYSIN DD *
SELECT COL1, COL2 FROM MYTABLE;
/*
//


Could that serve as an alternative?

Regards,

Kim



------------------------------
Kim Hoskin
Lead Technical Support Specialist
Rocket Internal - All Brands
------------------------------

Hi Bruce,

I have not tested the EXEC PGM=program approach, but depending on your requirement you could use DSN SYSTEM, see example JCL below (TEST is the XA Resource manager name, DSNTEP2 can be used to run dynamic SQL statement embedded in the jcl):

//DDLJOB2 JOB 
//RESETDB  EXEC PGM=IKJEFT01
//SYSTSPRT DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//SYSPUNCH DD  SYSOUT=*                                
//SYSUDUMP DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SYSTSIN  DD  *
 DSN SYSTEM(TEST)
 RUN  PROGRAM(DSNTEP2)
 END
/*
//SYSIN DD *
SELECT COL1, COL2 FROM MYTABLE;
/*
//


Could that serve as an alternative?

Regards,

Kim



------------------------------
Kim Hoskin
Lead Technical Support Specialist
Rocket Internal - All Brands
------------------------------

We are migrating from a mainframe database to SQL server.  Our current JCL jobs look like this:

STEP01  EXEC PGM=ourprogname

SYSCTL  DD DSN=ourmainframdb, DISP=SHR

I was hoping that I could replace the one "SYSCTL" line with a line that pointed to the XA resource.



------------------------------
Bruce Cheatwood
BWXT
Lynchburg VA US
------------------------------

We are migrating from a mainframe database to SQL server.  Our current JCL jobs look like this:

STEP01  EXEC PGM=ourprogname

SYSCTL  DD DSN=ourmainframdb, DISP=SHR

I was hoping that I could replace the one "SYSCTL" line with a line that pointed to the XA resource.



------------------------------
Bruce Cheatwood
BWXT
Lynchburg VA US
------------------------------

Hi Bruce,

I am not aware of there being specific syntax available that will do as you ask, but you can also consider testing / using a JCL procedure to setup/configure variables and pass those into the affected statement, or use a JCL exit to create and handle parameter substitution, or if you use mfbsi to use that to setup substitution with control-m. Note, I have not tested these and have not samples available to share. 

If you have a complete jcl sample and it does not work as expected you can also consider to raise a support case to seek further assistance that way.

Regards,
Kim



------------------------------
Kim Hoskin
Lead Technical Support Specialist
Rocket Internal - All Brands
------------------------------

We are migrating from a mainframe database to SQL server.  Our current JCL jobs look like this:

STEP01  EXEC PGM=ourprogname

SYSCTL  DD DSN=ourmainframdb, DISP=SHR

I was hoping that I could replace the one "SYSCTL" line with a line that pointed to the XA resource.



------------------------------
Bruce Cheatwood
BWXT
Lynchburg VA US
------------------------------

Hi Bruce,

In batch JCLs, XA resources can only be used via IKJEFT01 and DSNALI/DSNRLI.

Regards,
Laurence



------------------------------
Laurence Jao
Rocket Forum Shared Account
------------------------------