//REXXGEN EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DSN=&&TEMPPDS(ZPARMS),
// DISP=(,PASS),
// UNIT=SYSDA,SPACE=(TRK,(1,1,1),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//SYSUT1 DD *
/* REXX */
parse arg ssid
address tso "SUBCOM DSNREXX"
if rc then do
rc = rxsubcom('ADD','DSNREXX','DSNREXX')
if rc then exit
end
address dsnrexx
connect ssid
if sqlcode \= 0 then call sqlerror
proc = 'SYSPROC.ADMIN_INFO_SYSPARM' /* procedure to execute */
empty = ''
emptI = -1
msg = left(' ', 1331, ' ') /* output message */
msg_ind = '' /* indicator not null */
/* call the procedure */
execsql "call :proc (:empty :emptI, :rc, :msg :msg_ind)"
/* stored procedure returns +466: number of result sets */
if sqlcode < 0 then call sqlerror
/* to get the output from the call,
we need to associate the locator */
execsql "DESCRIBE PROCEDURE",
" :proc INTO :sqlda"
if sqlcode \= 0 then call sqlerror
execsql "ASSOCIATE LOCATOR (:result) ",
"WITH PROCEDURE :proc"
if sqlcode \= 0 then call sqlerror
/* allocate cursor for the result set */
execsql "ALLOCATE C101 CURSOR FOR RESULT SET :result"
if sqlcode \= 0 then call sqlerror
cursor = 'C101'
execsql "DESCRIBE CURSOR :cursor INTO :sqlda"
if sqlcode \= 0 then call sqlerror
do until(sqlcode \= 0)
execsql "FETCH C101 INTO " ,
":rownum, :macro, :parameter, :install_panel" ,
", :install_field, :install_location, :valux, :additional_info"
if sqlcode = 0 then do
say left(rownum,3) left(macro,8) left(install_panel,8) ,
left(install_field,24) ,
left(install_location,3) ,
left(additional_info,8) ,
left(parameter,24) ,
valux
insert = "INSERT INTO ZPARMST VALUES(" ,
"'" || parameter || "'," ,
"'" || valux || "'," ,
"'" || ssid || "')"
execsql insert
if sqlcode \= 0 then call sqlerror
end
end
execsql "CLOSE CURSOR :CURSOR"
execsql "COMMIT"
address dsnrexx "DISCONNECT"
rc = rxsubcom('DELETE','DSNREXX','DSNREXX')
exit
sqlerror:
say 'SQLCODE ='sqlcode
say 'SQLSTATE='sqlstate
say 'SQLERRMC='sqlerrmc
say 'SQLERRP ='sqlerrp
say 'SQLERRD ='sqlerrd.1','sqlerrd.2','sqlerrd.3,
||','sqlerrd.4','sqlerrd.5','sqlerrd.6
say 'SQLWARN ='sqlwarn.0','sqlwarn.1','sqlwarn.2,
||','sqlwarn.3','sqlwarn.4','sqlwarn.5,
||','sqlwarn.6','sqlwarn.7','sqlwarn.8,
||','sqlwarn.9','sqlwarn.10
exit 8
/*
//*
//RUNREXX EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT)
//STEPLIB DD DISP=SHR,DSN=prefix.SDSNEXIT
// DD DISP=SHR,DSN=prefix.SDSNLOAD
//SYSEXEC DD DSN=&&TEMPPDS,DISP=(OLD,DELETE)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
%ZPARMS dsn1
/*