/* REXX FIXDCB Alter the DSCB of an existing dataset Written by Frank Clarke, Oldsmar, FL */ address TSO signal on syntax tv = "" arg parms "((" opts opts = Strip(opts,T,")") /* clip trailing paren */ parse var opts "TRACE" tv . if tv ^= "" then interpret "TRACE" tv if parms = "" then call HELP if Word(parms,1) = "?" then call HELP rf = KEYWD(RECFM) if rf ^= "" then do parse var rf f1 2 f2 3 f3 . temp = Space(f1 f2 f3,1) end else do say "RECFM not specified. Adios." exit end lr = KEYWD(LRECL) if lr = "" then do say "LRECL not specified. Adios." exit end lr = Strip(lr) bl = KEYWD(BLKSIZE) if bl = "" then do say "BLKSIZE not specified. Adios." exit end bl = Strip(bl) parse var parms dsn parms if parms ^= "" then do say "Unknown parameters:" parms exit end rc = trace("o") if tv ^= "" then rc = trace(tv) "ALLOC FI(SYSUT1) DA('NULLFILE') LRECL("lr")", "BLKSIZE("bl") RECFM("temp") SHR REU" "ALLOC FI(SYSUT2) DA("dsn") MOD REU" "ALLOC FI(SYSIN) DUMMY SHR REU" "ALLOC FI(SYSPRINT) DA(*) SHR REU" "IEBGENER" "FREE FI(SYSUT1 SYSUT2 SYSIN)" "LISTD" dsn exit /*-------------------------------------------------------------------*/ HELP: /*@ */ address TSO "CLEAR" say " " say " FIXDCB Alters the DCB of an existing dataset. It does " say " this by setting up a model DCB and copying it via" say " IEBGENER on top of the existing DCB. " say " " say " WARNING ::::: this can permanently damage a " say " dataset, necessitating re-allocation and " say " re-population. Be sure you know what you are " say " doing before running FIXDCB. " say " " say " Syntax: FIXDCB " say " " say " " say " " say " " say " All parameters are required. There are no optional " say " parameters. " say " " exit /*@ HELP */ /*-------------------------------------------------------------------*/ KEYWD: Procedure expose, /*@ */ kw parms arg kw . if Wordpos(kw,parms) = 0 then, kw_val = "" else, if Wordpos(kw,parms) = 1 then, kwa = kw" " else kwa = " "kw" " parse var parms . value(kwa) kw_val . if kw_val <> "" then parms = Delword(parms,Wordpos(value(kw),parms),2) return kw_val /*@ KEYWD */ /*-------------------------------------------------------------------*/ SWITCH: /*@ */ arg kw . sw_val = Wordpos(value(kw),parms) > 0 if sw_val then parms = Delword(parms,Wordpos(value(kw),parms),1) return sw_val /*@ SWITCH */ /*-------------------------------------------------------------------*/ SYNTAX: /*@ */ errormsg = "REXX error" rc "in line" sigl":" errortext(rc) say errormsg say sourceline(sigl) trace "?r" nop exit /*@ SYNTAX */