/* REXX */
/* Created from Clist version of SRR$TSO  */
/*********************************************************************/
/* Change summary:                                                   */
/*   2009/12/16 - CLF, added use and contact info clauses.           */
/*   2012/10/26 - CF , chgd fso_spt@disa.mil to                      */
/*   disa.letterkenny.FSO.mbx.stig-customer-support-mailbox@mail.mil.*/
/*   2014/03/14 - CLF, Chgd "^=" to <>.                              */
/*                                                                   */
/*********************************************************************/
/*Trace r?*/
Parse source opsys . exec_name .
SRRIDFT  = 'SYS2.SRRAUDIT'
SRRUDFT  = 'SYS3.SRRAUDIT'
SRRCNTL  = 'CNTL'
SRRDMBR  = 'SRR$MAIN'
CACC1000 = 'CACC1000'
CONSLIST = 'OFF'
COMLIST  = 'OFF'
SYMLIST  = 'OFF'
TERMPRO  = 'ON'
TERMMSGS = 'OFF'
TRACE    = 'OFF'
 
If SysVar('SysEnv') <> "FORE" Then do
  Say pgmname "CLIST running in background, can not receive input SYSENV =",
    SysVar('SysEnv')
  RC = 8
  call ERR_EXIT
  End
 
Parse upper arg argument_list
argument_list = translate(argument_list,' ',',')
do i = 1 to length(argument_list)
  x = pos(') ',argument_list" ",i)
  data = substr(argument_list,i,x-i)
  data = translate(data,'=','(')
  interpret data
  i = x + 1
end
 
pgmname = "SRR$TSO  03/14/14"
pgm8    = substr(pgmname,1,8)
sysprompt = termpro
sysflush = "OFF"
sysasis = "ON"
If trace = "ON" Then do
  termmsgs = "ON"
  comlist = "ON"
  conslist = "ON"
  symlist = "ON"
  End
syssymlist = symlist
sysconlist = conslist
syslist = comlist
sysmsg = termmsgs
Address ISPEXEC
If CONSLIST = ON | COMLIST = ON | SYMLIST = ON | TRACE = ON ,
  then Trace r
"VPUT (CONSLIST COMLIST SYMLIST TERMMSGS) ASIS"
If RC <> 0 Then Say pgmname "VPUT RC =" RC zerrsm
"VGET (CNTLDSN) ASIS"
If RC <> 0 Then call Obtain_data
"VPUT (CNTLDSN) SHARED"
If RC <> 0 Then Say pgmname "VPUT ASIS RC =" RC zerrsm
Address TSO "ALTLIB DEACT APPLICATION(CLIST) QUIET"
Address TSO "ALTLIB RESET QUIET"
"LIBDEF ISPPLIB DATASET ID('"cntldsn"')"
Address TSO "ALTLIB ACTIVATE APPLICATION(CLIST) DATASET('"cntldsn"')"
"SELECT CMD("cacc1000 "ACP)"
"SELECT CMD("srrdmbr")"
RC = 0
"LIBDEF ISPPLIB"
Address TSO "ALTLIB DEACT APPLICATION(CLIST) QUIET"
Address TSO "ALTLIB RESET QUIET"
RC = 0
ERR_EXIT:
zispfrc = RC
"VERASE (CNTLDSN) PROFILE"
"VPUT (ZISPFRC) SHARED"
Exit zispfrc
 
Obtain_data:
zcfld = "SINST"
"VGET (SRRINST SRRUSER) PROFILE"
"CONTROL ERRORS RETURN"
prefix = sysvar('SYSPREF')        /* tso profile prefix            */
uid    = sysvar('SYSUID')         /* tso userid                    */
If prefix = '' then prefix = uid  /* use uid if null prefix        */
If prefix <> '' & prefix <> uid then /* different prefix than uid  */
   prefix = prefix || '.' || uid /* use  prefix.uid                */
ddnm1 = 'DD'||random(1,99999)   /* choose random ddname            */
Address TSO "ALLOC FILE("||ddnm1||") UNIT(SYSALLDA) NEW TRACKS",
  "SPACE(1,1) DELETE REUSE LRECL(80) RECFM(F B) BLKSIZE(3120)",
  "DIR(1) DA('"||prefix||"." ||ddnm1|| ".ISPPLIB')"
Address TSO "Newstack"
/*************************/
/* SRRPTSO Panel source  */
/*************************/
If Substr(ZENVIR,6,1) >= 4 then
  Queue ")PANEL KEYLIST(ISRSPBC,ISR)"
Queue ")ATTR"
Queue " _ TYPE(INPUT)  INTENS(HIGH) CAPS(ON) PADC(_)"
Queue " + TYPE(TEXT)    INTENS(LOW)  COLOR(BLUE)"
Queue " @ TYPE(OUTPUT) INTENS(LOW)  SKIP(ON)"
Queue " ! TYPE(OUTPUT)  INTENS(HIGH)"
Queue " # TYPE(OUTPUT) INTENS(HIGH) SKIP(ON) CAPS(OFF)"
Queue " $ TYPE(OUTPUT) INTENS(HIGH) COLOR(RED) SKIP(ON) CAPS(OFF)"
Queue ")BODY EXPAND(//)"
Queue "%/-/ Security Readiness Review Self-Audit /-/+"
Queue "@PGM8     %/ /DIALOG Setup/ /          +"
Queue "%/=/"
Queue "%|/ /This software is for DoD use only./ /|"
Queue "%|/=/|"
Queue "%|/ /Contact information: If there are issues with scripts",
  "please contact/ /|"
FSOSPT = "disa.letterkenny.FSO.mbx.stig-customer-support-mailbox@mail.mil"
Queue "%|/ /#FSOSPT                                                      ",
  "   %/ /|"
Queue "%/=/"
Queue "+"
Queue "+The current system install library high level qualifier is:"
Queue "     !SRRINST                       +"
Queue "+"
Queue "+Type new HLQ: _SINST                         +"
Queue "+"
Queue "+The current user library high level qualifier is:"
Queue "     !SRRUSER                       +"
Queue "+"
Queue "+Type new HLQ: _SUSER                         +"
Queue "+"
Queue "%EXIT +(PF3) To end. / / Press%Enter+to use current high" ,
  "level qualifiers+"
Queue "+"
Queue "#SRRMSG1"
Queue "#SRRMSG2"
Queue ")INIT"
/*Queue "IF (&ZCFLD = SUSER) .CURSOR = SUSER"*/
Queue ".CURSOR = &ZCFLD"
Queue "IF (&SRRINST = '') &SRRINST = &SRRIDFT"
Queue "IF (&SRRUSER = '') &SRRUSER = &SRRUDFT"
Queue ")PROC"
Queue ")END"
Address TSO "ALLOC FILE(SRRPTSO) SHR REUSE",
  "DA('"||prefix||"."||ddnm1|| ".ISPPLIB(SRRPTSO)')"
Address TSO "EXECIO" Queued() "DISKW SRRPTSO (FINIS"
Address TSO "Delstack"
Address TSO "FREE FILE(SRRPTSO)"
"SETMSG MSG(ISRZ002)"
"LIBDEF ISPPLIB LIBRARY ID("||ddnm1||") STACK"
do forever
  "DISPLAY PANEL(SRRPTSO)"
  if rc = 8 then do
    "LIBDEF ISPPLIB"
    Address TSO "FREE FI("||ddnm1||")"
    rc = 0
    signal ERR_EXIT
    end
  if "."sinst <> "."  Then srrinst = sinst
  if "."suser <> "."  Then srruser = suser
  cntldsn = srrinst"."srrcntl
  locate = sysdsn("'"cntldsn"("cacc1000")'")
  if locate <> "OK" then do
    zcfld = "SINST"
    srrmsg1 = "DSN="cntldsn "Data Set Error   MBR="cacc1000
    srrmsg2 = locate
    "VGET (SRRINST SRRUSER) PROFILE"
    iterate
    end
  locate = sysdsn("'"cntldsn"("srrdmbr")'")
  If locate <> "OK" Then Do
    zcfld = "SINST"
    srrmsg1 = "DSN="cntldsn "Data Set Error   MBR="srrdmbr
    srrmsg2 = locate
    "VGET (SRRINST SRRUSER) PROFILE"
    iterate
    End
  userdsn = srruser"."srrcntl
  locate = sysdsn("'"userdsn"'")
  If locate <> "OK" Then Do
    zcfld = "SUSER"
    srrmsg1 = "DSN="userdsn "Data Set Error"
    srrmsg2 = locate
    "VGET (SRRINST SRRUSER) PROFILE"
    iterate
    end
  leave
end
"VPUT (SRRINST SRRUSER CNTLDSN) PROFILE"
"LIBDEF ISPPLIB"
Address TSO "FREE FI("||ddnm1||")"
return
 
