/* REXX */ trace o /* ---------------------------------------------------------------- */ /* Name : configba */ /* Funktion: Erstellen einer OPC Configuration DB im batch */ /* */ /* Erstellt: 03/2000 E.Duemig */ /* */ /* ---------------------------------------------------------------- */ arg sysplex /* sysplex name from sysin */ /* ---------------------------------------------------------------- */ /* Library management */ /* ---------------------------------------------------------------- */ parmdd="PARM"sysplex address ispexec "lminit" , /* LMINIT for parmlib */ "ddname("parmdd")" , /* */ "dataid(parmlib)" , /* */ "enq(shr)" /* */ hrc=rc /* */ if hrc/=0 then , /* if error */ call sverr "LMINIT",hrc,joblib /* call routine SVERR */ /* */ address ispexec "lmopen" , /* open the parmlib */ "dataid("parmlib")" , /* */ "option(input)" /* */ hrc=rc /* */ if hrc/=0 then , /* */ call sverr "LMOPEN",hrc,joblib /* see before */ count=0 /* */ do while hrc=0 address ispexec "lmmlist" , /* LMMLIST all members */ "dataid("parmlib")" , /* in parmlib */ "option(list)" , /* */ "member(mem)" /* */ hrc=rc /* */ if hrc/=0 & hrc/=8 then , /* */ call sverr "LMMLIST",hrc,joblib /* as it was */ if hrc=8 then /* rc=8 means end of list */ do hrc=0 leave end address ispexec "lmmfind" , /* find the member in ds */ "dataid("parmlib")" , /* given from LMMLIST */ "member("mem")" /* */ hrc=rc /* */ if hrc/=0 then , /* */ call sverr "LMMLIST",hrc,joblib /* see before */ rec_rc=0 do while rec_rc=0 & mem /= "OPCB" /* do while getting records */ address ispexec "lmget" , /* read the next record */ "dataid("parmlib")" , /* form the existing member */ "mode(invar)" , /* */ "dataloc(inrec)" , /* */ "datalen(datalen)" , /* */ "maxlen(80)" /* */ rec_rc=rc /* take the rc */ if rec_rc=0 then count=count+1 /* count if getting a record*/ prm.count=inrec /* all jcl lines to a stem */ end /* */ buff=count if count>0 then call main end /* */ call exit /* */ /* ------------------------------------------------------------------ */ /* SVERR - Severe error message */ /* ------------------------------------------------------------------ */ sverr: /* */ /* */ say "Fehler bei" arg(1) "RC=" arg(2) /* ARG(1) is the service */ say zerrlm /* ARC(3) is the DDNAME */ hrc=max(hrc,16) /* the long message, hrc */ call exit /* and end the program */ return /* */ /* ------------------------------------------------------------------ */ /* EXIT */ /* ------------------------------------------------------------------ */ exit: /* */ exit hrc /* ------------------------------------------------------------------ */ /* main - the main section */ /* ------------------------------------------------------------------ */ /* */ main: ostr="";count=0;old_key="";newln_old=0;ns=0 do x=1 to buff pstr=substr(prm.x,1,72) comm = index(pstr,"/*") star = index(pstr,"* ") dsta = index(pstr,"**") if comm=1 ! star=1 ! dsta=1 then pstr="" if comm>1 then pstr=substr(pstr,1,(comm-1)) if star>1 then pstr=substr(pstr,1,(star-1)) pstr=strip(pstr) pstl=length(pstr) scomm=lastpos(",",pstr) if scomm>0 & scomm=pstl then newln=1 else newln=0 if pstr>"" then do push pstr parse pull v.1 v.2 v.3 v.4 v.5 do y=1 to 5 v.y=strip(v.y) end if v.1="NOERROR" then ns=1 v1opar=index(v.1,"(") v1cpar=index(v.1,")") v1comm=index(v.1,",") v1equa=index(v.1,"=") v1dot =lastpos(".",v.1) if v1opar = 0 &, v1cpar = 0 &, v1comm = 0 &, v1equa = 0 &, v1dot = 0 &, newln_old = 0 &, v.1 /= "NOERROR" &, mem /= "RESOURCE" &, v.1 /= old_key then do ns=0 old_key = v.1 ostr=ostr";@"v.1 do q=2 to 5 if v.q>"" then do ostr=ostr";"v.q end end end else do if mem="RESOURCE" ! v.1="AUDIT" then do if mem = "RESOURCE" then do ostr=ostr";"v.1 v.2 end if v.1 = "AUDIT" then do q=2 to 5 if v.q>"" then ostr=ostr";"v.q end end else do if ns=0 then do if newln=1 & newln_old=0 then ostr=ostr";"pstr if newln=1 & newln_old=1 ! , newln=0 & newln_old=1 then ostr=ostr" "pstr if newln=0 & newln_old=0 then do q=1 to 5 if v.q>"" then ostr=ostr";"v.q end end end end end newln_old=newln end mem=strip(mem) if substr(ostr,2,1) ^= "@" then do if mem="RESOURCE" then mem="#RESOURC" ostr=";@"mem""ostr end ostr=sysplex";"mem""ostr";" push ostr execio 1 diskw confout return exit