Loading

Running DSNTEP2 / DSNTEP4 using IKJEFT01 for batch SQL(DB2) processing

The output of these utilities will be exactly like executing a Spufi. It will have the complete details of the query and formatted columns. If you just want the resultset (in the unload format) Please read about the DSNTIAUL utility.

DSNTEP2 / DSNTEP4: These programs are used to execute the SQL queries in batch.

The output (SYSPRINT) will have complete details of the query execution.
DSNTEP2 is a PL/I program used to process SELECT and NON SELECT statements dynamically.

//STEP0001 EXEC PGM=IKJEFT01 ,DYNAMNBR=20
//STEPLIB  DD DISP=SHR,
//            DSN='SSID.SDSNLOAD'
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(250,100),RLSE),
//            UNIT=DISK,
//            DCB=(RECFM=FB,LRECL=133,BLKSIZE=0),
//            DSN=TEST.MYDSN
//SYSUDUMP DD SYSOUT=*
//SYSTERM  DD SYSOUT=*
//SYSTSOUT DD SYSOUT=*
//SYSTSIN  DD *
  DSN SYSTEM(SSID)
  RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) PARM('ALIGN(LHS)')
  LIB ('SSID.SDSNLOAD')
/*
//SYSIN    DD *
 SELECT * FROM SYSIBM.SYSDUMMY1
/*

The Parm for this program is optional.

Valid values are,

ALIGN(MID) – center alignment

ALIGN(LHS) – left alignment

MAXSEL(n) – to limit the number of rows returned from a
SELECT statement to n (n = 0 -> 32768)
NOMIXED – ??

MIXED  – ??

SQLTERM(termchar) – termchar is the character that you use to end each SQL
| statement.

Related Posts




blog comments powered by Disqus

There's 2 Comments So Far

Share your thoughts, leave a comment!