Appendix D. REXX procedures for table space partitioning 199
SAY NEWDSN' EXISTS ALREADY. ',
'TERMINATING UNTIL CORRECTED.'
EXITRC = 9
END
ELSE
DO
"DELETE '"NEWDSN"'"
END
END
IF SYSDSN("'"||newdsn||"'") = "DATASET NOT FOUND" THEN
DO
"alloc da('"newdsn"') like('"LDCard"') "
"free dataset('"newdsn"') "
END
ADDRESS ISPEXEC
"LMINIT DATAID(FDID) DATASET("PDS_i") ENQ(SHR)"
"LMINIT DATAID(TDID) DATASET("PDS_o") ENQ(EXCLU)"
IF RC <> 0 THEN
DO
SAY 'UNABLE TO GET EXCLU ENQUEUE ON 'PDS_o
SAY 'LOADGEN WILL TERMINATE NOW.'
EXIT 11
END
"LMCOPY FROMID("FDID") FROMMEM(*)",
" TODATAID("TDID") REPLACE "
IF RC <> 0 THEN
DO
SAY 'Unable to copy loadcards to output pds' PDS_o
SAY 'LOADGEN WILL TERMINATE NOW.'
EXIT 12
END
Return
/*-----------------------------------------------------------------*/
Get_Util_Sysin_Parameters:
/* */
Address tso
'EXECIO * DISKR SYSIN (STEM UTIL_SYSIN.'
If RC > 0 Then
Do
Err_Msg = 'Unable to Read Input Parameters'
End
Else
Do
Sysin_Parms = ''
200 Siebel 7 with DB2 for z/OS: Database Implementation and Administration Guide
Do Sysin_Rec_Cnt = 1 To Util_Sysin.0
Sysin_Parms = Sysin_Parms||,
Strip(Util_Sysin.Sysin_Rec_Cnt,'B')||'$$'
End
End
Call Check_and_Reformat_Parms
If GOTBILD = 'Y' & GOTPDS = 'Y' & GOTMACNM = 'Y' &,
GOTHOST = 'Y' & GOTTABIN = 'Y' then
GOTPARMS = 'Y'
Else
GOTPARMS = 'N'
Return
/*------------------------------------------------------------------*/
Check_and_Reformat_Parms:
Parse Var Sysin_Parms Key_Word '=' Key_Word_Value '$$' Sysin_Parms_Rem
GOTBILD = 'N'
GOTCREATR = 'N'
GOTSSID = 'N'
GOTLOAD = 'N'
GOTRUN = 'N'
GOTMACNM = 'N'
GOTPARMS = 'N'
SYSIN_CNT = 0
StatsChk = 'OK'
BILD = '?'
LOC = '?'
Do Until Strip(Key_Word_Value,'B') = ''
Chkrmk1 = Pos('/*',Key_Word_Value,1)
If Chkrmk1 > 0 then
Do
lenkwv = Length(Key_Word_Value)
Chkrmk2 = Pos('*/',Key_Word_Value,Chkrmk1)
If Chkrmk2 > 0 then
Do
TrlLen = lenkwv - Chkrmk2 - 1
Chkrmk2 = Chkrmk2 + 2
Key_word_Value1 = Substr(Key_Word_Value,1,Chkrmk1-1)
Key_word_Value2 = Substr(Key_Word_Value,Chkrmk2,TrlLen)
Key_word_Value = Key_Word_value1||Key_Word_Value2
End
Else
Appendix D. REXX procedures for table space partitioning 201
Do
Key_word_Value1 = Substr(Key_Word_Value,1,Chkrmk1-1)
Key_word_Value = Key_Word_value1
End
End
Select
When Key_Word = 'BUILD' then
Do
BILD = Strip(Key_Word_Value,'B')
IBILD = BILD
T2BILD = BILD
GOTBILD ='Y'
End
When Key_Word = 'TABLEOWNER' then
Do
TABCRTR = Strip(Key_Word_Value,'B')
CREATR = TABCRTR
End
When Key_Word = 'MACRO_NAME' then
Do
MACNAME = Strip(Key_Word_Value,'B')
GOTMACNM ='Y'
End
When Key_Word = 'SSID' then
Do
LOCSSID = Strip(Key_Word_Value,'B')
SSID = LOCSSID
GOTHOST ='Y'
End
When Key_Word = 'LOADPDS' then
Do
LDCard = Strip(Key_Word_Value,'B')
GOTPDS ='Y'
End
When Key_Word = 'TABLEINP' then
Do
TABLE_INP = Strip(Key_Word_Value,'B')
GOTTABIN ='Y'
End
When Key_Word = 'DELOUTPDS' then
Do
202 Siebel 7 with DB2 for z/OS: Database Implementation and Administration Guide
DELCRDS = Strip(Key_Word_Value,'B')
End
OTHERWISE
Do
Err_Msg = 'Invalid Parameter 'Key_Word
StatsChk = 'ERR'
End
End
Parse Var Sysin_Parms_Rem ,
Key_Word '=' Key_Word_Value '$$' Sysin_Parms_Rem
End
Call Display_Parameter
Return
/*----------------------------------------------------------------*/
Display_Parameter:
Say '#'Copies('-',78)'#'
Say '#'left('LOADGEN Parameters',78)'#'
Say '#'Copies('-',78)'#'
Say '#'left('--> BUILD ='BILD,78)'#'
Say '#'left('--> CREATOR ='CREATR,78)'#'
Say '#'left('--> SSID ='SSID,78)'#'
Say '#'left('--> MACRO_NAME='MACNAME,78)'#'
Say '#'left('--> TABLEINP ='TABLE_INP,78)'#'
Say '#'left('--> DELOUTPDS ='DELCRDS,78)'#'
Say '#'left('--> LOADPDS ='LDCard,78)'#'
Say '#'Copies('-',78)'#'
Return
/***************************************************************/
SQLERR:
trace('o')
SAY "-------------------- SQL ERROR -----------------------"
SAY "SQLSTATE="SQLSTATE
SAY "SQLWARN ="SQLWARN.0
SAY SQLWARN.1","
SAY SQLWARN.2","
SAY SQLWARN.3","
SAY SQLWARN.4","
SAY SQLWARN.5","
SAY SQLWARN.6","
SAY SQLWARN.7","
SAY SQLWARN.8","
SAY SQLWARN.9","
Appendix D. REXX procedures for table space partitioning 203
SAY SQLWARN.10","
SAY "SQLERRD="SQLERRD.1
SAY SQLERRD.2","
SAY SQLERRD.3","
SAY SQLERRD.4","
SAY SQLERRD.5","
SAY SQLERRD.6","
SAY "SQLERRP="SQLERRP
SAY "SQLERRMC="SQLERRMC
SAY "SQLCODE="SQLCODE
EXITRC=20
SAY "LOADGEN TERMINATING WITH RC=20"
RETURN
/************************************************************/
Example: D-13 LOADSKEL member
//&JOBNAME JOB ACCNT#,CLASS=&CLASS.,MSGCLASS=X,MSGLEVEL=(1,1),
// TIME=1440,REGION=&RGN.,LINES=(500,WARNING),COND=(4,LT),
// NOTIFY=&&SYSUID
/*JOBPARM S=&LPAR.
//JOBLIB DD DISP=SHR,DSN=DB7R7.SDSNLOAD
//*-------------------------------------------------------------------
//* LOAD TABLE &TBNM. TABLE #: &TABLBL.
//*------------------------------------------------------------------
//STP01 EXEC PGM=DSNUTILB,REGION=0M,PARM='&SSID.,&JOBNAME.LD'
//STEPLIB DD DSN=DB7R7.SDSNLOAD,DISP=SHR
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//UTPRINT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD DISP=SHR,
// DSN=&DSYSIN.
//SYSREC00 DD DISP=SHR,
// DSN=&DSYSREC.
//SYSUT1 DD DSN=&ZUSER..&SSID..&TABLBL..SYSUT1,
// DISP=(MOD,DELETE,CATLG),UNIT=(SYSDA,7),
// SPACE=(CYL,(500,500),RLSE)
//SORTOUT DD DSN=&ZUSER..&SSID..&TABLBL..SORTOUT,
// DISP=(MOD,DELETE,CATLG),UNIT=(SYSDA,7),
// SPACE=(CYL,(500,500),RLSE)
//*--------------------------------------------------------------
//* EOM

Get Siebel 7 with DB2 for z/OS: Database Implementation and Administration Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.