ISREDIT MACRO       /* CATM000A EDIT PDI(*)  */
 
/* 04/20/2004 JL.Nelson Changed to display No Finding text
/* 06/18/2004 JL.NELSON ADDED EXIT CODE
/* 07/15/2004 JL.Nelson Changed DISA Standard to STIG requirement
/* 12/15/2004 JL.Nelson Changed TSS0620, TSS0650, STIG incorrect
/* 02/09/2005 JL.NELSON Changed constants to variables before rename
/* 04/13/2005 JL.NELSON Added AUTOERASE(ALL) check
/* 06/08/2005 JL.NELSON Pass MAXCC in ZISPFRC variable
/* 06/14/2005 JL.Nelson Changed STIG requirement to DISA recommendation
/* 06/14/2005 JL.Nelson Changed default logic
/* 06/14/2005 JL.Nelson Supress DISA recommendation for FSO
/* 06/14/2005 JL.Nelson Supress TEXT not found for FSO
/* 03/15/2006 JL.NELSON Made changes to avoid SUBSTR abend 920/932.
/* 03/21/2006 JL.NELSON Use NRSTR avoid abend 900 if ampersand in data.
/* 05/09/2006 JL.NELSON Avoid RC 20 on ISREDIT LINE when " or ' in data.
/* 09/27/2006 CL.FENTON Chg to use ACPVERS over VERSION variable.
/* 09/27/2006 CL.FENTON Chg TSS0270 for Manual review on Unclassified
/*            and Not a Finding for YES|ALL settings.
/* 09/27/2006 CL.FENTON Added test for ZUSST052, split from ZUSST050.
/*            Chg ZUSST050 when nothing is specified for both fields,
/*            Not a Finding else Manual review.
/* 06/28/2007 CL.FENTON Changed test for TSS0450 to Not Applicable
/*            when ACPVERS is 9.0 or greater.
/* 07/09/2007 CL.FENTON Resolved several rc 20 error on ISREDIT cmds.
/*            Changed evaluation of TSS0270 and ZUSST050 to
/*            review CLASS.
/* 08/07/2007 CL.FENTON Changed characters that identify breaks to
/*            Non-national or special characters that could appear
/*            in PASSCHAR control option.
/*            Added additional analysis on NEWPW adding SC and
/*            PASSCHAR checks.  Started with version 9.0.
/*            in PASSCHAR control option.
/*            Added analysis for ZUSST060, to review HSFSEC resourc
/*            class in the RDT.
/* 10/15/2007 CL.FENTON Changed &STR to &NRSTR to allow use of & in
/*            PASSCHAR.
/* 05/05/2008 CL.FENTON Changed evaluation of ACPVERS to execute
/*            CACC1000 ACPCOMP to compare ACPVERS with var.
/* 05/05/2008 CL.FENTON Changed ACPVERS evaluation removing 8.0 and
/*            below checks.
/* 05/12/2009 CL.FENTON Changed TSS0450 evaluation of 9.0 not applicable.
/*            Removed ACPVERS checking.
/* 10/09/2009 CL.FENTON Added analysis of TSS0460 to be consistant with
/*            the VMS check.
/* 03/15/2011 CL.FENTON Chgd TSS0400 test from 35 to 30 days.
/* 05/25/2011 CL.FENTON Reverted TSS0400 test from 30 to 35 days.
/* 03/08/2013 CL.Fenton Added TSS0660, TSS0670, TSS0680, and TSS0690
/*            to evaluate NEWPHRASE, PPSCHAR, NPPTHRESH, PPEXP, and
/*            PPHIST Control option settings, CSD-AR003262504.
/* 05/28/2013 CL.Fenton Corrected TSS0660 rc=852 error, STS-002990.
/*            Also made cosmetic changes to this PDI.
/* 07/17/2013 CL.Fenton Corrected NEWPHRASE tests for MA and MN to
/*            specify GE, STS-003491.
/* 09/24/2013 CL.Fenton Chgd requirements for TSS0270, STS-003180.
/* 12/10/2014 CL.Fenton Added ZUSST052 to evaluate CHOWNURS with TSS
/*            V15 RO6374 PTF remove CHOWNURS control option, STS-006695.
/* 01/30/2015 CL.Fenton Chgd TSS0660 to evaluate MIN=15 for NEWPHRASE,
/*            STS-008965.
/* 02/04/2015 CL.Fenton Chgd TSS0480 to check for special characters,
/*            STS-004529.
/* 02/04/2015 CL.Fenton Chgd TSS0660 to check for special characters and
/*            removed ID and NR= requirements, STS-008965.
/* 08/24/2016 CL.Fenton Chgd TSS0400 to INACTIVE(0), STS-015248.
/* 07/18/2017 CL.Fenton Chgd ZUSST050 to check for setting of UNIQUSER
/*            is OFF, STS-017961.
/* 11/15/2017 CL.Fenton Added TSS0485 to check the setting of AESENC for
/*            the value of 128 or 256, STS-018642.
/* 05/23/2018 CL.Fenton Added "Not Reviewed" to TSS0270 when AUTOERASE
/*            is not ALL, TSS0460 when MODE(IMPL) is specified,
/*            ZUSST050 when system classification is classified or not
/*            defined and UNIQUSER is not OFF, TSS0330, and TSS0420
/*            for vuls that require additional analysis, STS-019713.
/* 02/20/2019 CL.Fenton Chgd TSS0480 and TSS0660 evaluation that all
/*            special characters be specified in PASSCHAR and
/*            PPSCHAR, STS-021085.
 
SET PGMNAME = &STR(CATM000A 02/20/19)
 
SET SYSPROMPT = OFF                /* CONTROL NOPROMPT          */
SET SYSFLUSH  = OFF                /* CONTROL NOFLUSH           */
SET SYSASIS   = ON                 /* CONTROL ASIS - caps off   */
 
/* *************************************** */
/* THIS EDIT MACRO PROVIDES THE FINDING    */
/* DETAILS FOR TSS MODIFY(ST)              */
/* *************************************** */
 
/* ERROR ROUTINE */
ERROR DO
  SET RETURN_CODE = &LASTCC          /* SAVE LAST ERROR CODE */
  IF &LASTCC GE 16 THEN +
    WRITE &PGMNAME LASTCC = &LASTCC &ZERRLM
  RETURN
  END
 
/* *************************************** */
/* VARIABLES ARE PASSED TO THIS MACRO      */
/* CONSLIST                                */
/* COMLIST                                 */
/* SYMLIST                                 */
/* TERMMSGS                                */
/* *************************************** */
 
ISPEXEC CONTROL NONDISPL ENTER
ISPEXEC CONTROL ERRORS RETURN
SET RETURN_CODE = 0
 
ISPEXEC VGET ( +
  CONSLIST     +
  COMLIST      +
  SYMLIST      +
  TERMMSGS     +
  ACPVERS      +
  FINDRC       +
  PDITEXT      +
  DISATXT      +
  FINDTXT8     +
  TYPERUN      +
  ) ASIS
 
SET TM0AVGET = &RETURN_CODE
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME VGET_RC = &RETURN_CODE &ZERRSM
  WRITE &PGMNAME CONSLIST/&CONSLIST COMLIST/&COMLIST SYMLIST/&SYMLIST +
    TERMMSGS/&TERMMSGS
  WRITE &PGMNAME ACPVERS/&ACPVERS FINDRC/&FINDRC PDITEXT/&PDITEXT +
    DISATXT/&DISATXT FINDTCT8/&FINDTXT8 TYPERUN/&TYPERUN
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
/* *************************************** */
/* TURN ON MESSAGES                        */
/* *************************************** */
 
SET SYSSYMLIST = &SYMLIST           /* CONTROL SYMLIST/NOSYMLIST */
SET SYSCONLIST = &CONSLIST          /* CONTROL CONLIST/NOCONLIST */
SET SYSLIST    = &COMLIST           /* CONTROL LIST/NOLIST       */
SET SYSMSG     = &TERMMSGS          /* CONTROL MSG/NOMSG         */
 
/* *************************************** */
/* MAIN PROCESS                            */
/* *************************************** */
 
SET LP = &STR((
SET RP = )
SET ROW = 0
 
SET RETURN_CODE = 0
 
SET SPC = &STR(          )
 
ISREDIT CAPS = OFF
ISREDIT STATS = OFF
ISREDIT (ROW) = LINENUM .ZLAST
IF &ROW GT 0 THEN +
  ISREDIT DELETE .ZFIRST .ZLAST
 
SET XF = &SYSINDEX(&STR(~),&NRSTR(&PDITEXT)) + 1
SET XL = &SYSINDEX(&STR(<),&NRSTR(&PDITEXT),&XF) - 1
 
IF &SUBSTR(1,&NRSTR(&PDITEXT)) EQ &STR(1) THEN +
  GOTO ADDITIONAL_CHK
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
IF &FINDRC EQ 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
ADDITIONAL_CHK: +
SET RETURN_CODE = 0
 
ISREDIT (PDINUM) = MEMBER
 
IF &NRSTR(&PDINUM) NE TSS0249 AND +
   &NRSTR(&PDINUM) NE TSS0385 AND +
   &NRSTR(&PDINUM) NE TSS0505 THEN +
  GOTO BYPASS_TSS0249
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
IF &NRSTR(&PDINUM) NE TSS0505 THEN +
  GOTO BYPASS_TSS0505
 
/****************************************************/
/* ADDITIONAL TESTS FOR TSS0505 (OPTIONALS).  OTHER */
/* FINDING SENT TO BYPASS_TSS0505.                  */
/****************************************************/
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET FLD = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))&STR(,)
ELSE +
  GOTO A_FINDING
 
IF &SYSINDEX(&STR(004,),&NRSTR(&FLD)) GT 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0505: +
IF &FINDRC EQ 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0249: +
IF &NRSTR(&PDINUM) NE TSS0260 THEN +
  GOTO BYPASS_TSS0260
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
/****************************************************/
/* TEST FINDRC WHEN CONTROL OPTION HAS 2 POSSIBLE   */
/* VALUES AVAILABLE.                                */
/****************************************************/
 
SET O1 = &SYSINDEX(&STR(OVERRIDE),&NRSTR(&PDITEXT))
SET O2 = &SYSINDEX(&STR(MERGE),&NRSTR(&PDITEXT))
SET O3 = &SYSINDEX(&STR(ALLOVER),&NRSTR(&PDITEXT))
 
IF (&O1 GT 0 OR &O2 GT 0) AND +
   &O3 GT 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
BYPASS_TSS0260: +
IF &NRSTR(&PDINUM) NE TSS0360 THEN +
  GOTO BYPASS_TSS0360
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET &DOWN = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET &BW = &SYSINDEX(&STR(BW),&NRSTR(&DOWN))
SET &SB = &SYSINDEX(&STR(SB),&NRSTR(&DOWN))
SET &TN = &SYSINDEX(&STR(TN),&NRSTR(&DOWN))
SET &TW = &SYSINDEX(&STR(TW),&NRSTR(&DOWN))
SET &OW = &SYSINDEX(&STR(OW),&NRSTR(&DOWN))
 
IF (&BW GT 0) AND +
   (&SB GT 0) AND +
   (&TN GT 0 OR &TW GT 0) AND +
   (&OW GT 0) THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0360: +
IF &NRSTR(&PDINUM) NE TSS0440 THEN +
  GOTO BYPASS_TSS0440
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET LOG = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET INIT = &SYSINDEX(&STR(INIT),&NRSTR(&LOG))
SET SEC9 = &SYSINDEX(&STR(SEC9),&NRSTR(&LOG))
SET SMF  = &SYSINDEX(&STR(SMF),&NRSTR(&LOG))
SET MSG  = &SYSINDEX(&STR(MSG),&NRSTR(&LOG))
 
IF (&INIT GT 0) AND +
   (&SEC9 GT 0) AND +
   (&SMF  GT 0) AND +
   (&MSG  GT 0) THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0440: +
IF &NRSTR(&PDINUM) NE TSS0270 THEN +
  GOTO BYPASS_TSS0270
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
ISPEXEC VGET ( +
  CLASS        +
  ) ASIS
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET OPT = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET EY = &SYSINDEX(&STR(YES),&NRSTR(&OPT))
SET EN = &SYSINDEX(&STR(NO),&NRSTR(&OPT))
SET EA = &SYSINDEX(&STR(ALL),&NRSTR(&OPT))
SET E3 = &EY + &EN + &EA
 
IF &E3 EQ 0 THEN +
  GOTO A_FINDING
 
IF &EA GT 0 THEN +
  GOTO NOT_A_FINDING
 
SET AC = &STR(Not Reviewed)
ISREDIT LINE_AFTER .ZLAST = (AC)
 
GOTO A_FINDING
 
BYPASS_TSS0270: +
IF &NRSTR(&PDINUM) NE TSS0320 AND +
   &NRSTR(&PDINUM) NE TSS0420 AND +
   &NRSTR(&PDINUM) NE TSS0590 THEN +
  GOTO BYPASS_TSS0320
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
IF &FINDRC EQ 0 THEN +
  GOTO NOT_A_FINDING
 
IF &NRSTR(&PDINUM) NE TSS0420 THEN DO
  SET AC = &STR(Not Reviewed)
  ISREDIT LINE_AFTER .ZLAST = DATALINE (AC)
  END
 
GOTO A_FINDING
 
BYPASS_TSS0320: +
IF &NRSTR(&PDINUM) NE TSS0330 THEN +
  GOTO BYPASS_TSS0330
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
IF &SYSINDEX(&STR(DIAGTRAP ENTRIES: ON = 00),+
   &NRSTR(&PDITEXT)) GT 0 THEN +
  GOTO NOT_A_FINDING
 
SET AC = &STR(Not Reviewed)
ISREDIT LINE_AFTER .ZLAST = DATALINE (AC)
 
GOTO A_FINDING
 
 
BYPASS_TSS0330: +
IF &NRSTR(&PDINUM) NE TSS0340 THEN +
  GOTO BYPASS_TSS0340
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
IF &FINDRC EQ 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
BYPASS_TSS0340: +
IF &NRSTR(&PDINUM) NE TSS0370 AND +
   &NRSTR(&PDINUM) NE TSS0510 AND +
   &NRSTR(&PDINUM) NE TSS0520 THEN +
  GOTO BYPASS_TSS0370
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
IF &FINDRC EQ 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0370: +
IF &NRSTR(&PDINUM) NE TSS0390 AND +
   &NRSTR(&PDINUM) NE TSS0400 AND +
   &NRSTR(&PDINUM) NE TSS0500 AND +
   &NRSTR(&PDINUM) NE TSS0540 AND +
   &NRSTR(&PDINUM) NE TSS0550 AND +
   &NRSTR(&PDINUM) NE TSS0560 AND +
   &NRSTR(&PDINUM) NE TSS0650 AND +
   &NRSTR(&PDINUM) NE TSS0670 AND +
   &NRSTR(&PDINUM) NE TSS0680 AND +
   &NRSTR(&PDINUM) NE TSS0690 THEN +
  GOTO BYPASS_TSS0390
 
/****************************************************/
/* TEST FOR FINDINGS WITH NUMERIC VALUE RANGES      */
/****************************************************/
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET FLD = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
IF &DATATYPE(&FLD) NE &STR(NUM) THEN +
  GOTO A_FINDING
 
IF (&PDINUM EQ TSS0390 AND (&FLD GE  1 AND &FLD LE  3)) OR +
   (&PDINUM EQ TSS0400 AND (&FLD EQ  0               )) OR +
   (&PDINUM EQ TSS0500 AND (&FLD EQ  2              )) OR +
   (&PDINUM EQ TSS0670 AND (&FLD EQ  2              )) OR +
   (&PDINUM EQ TSS0540 AND (&FLD GE  1 AND &FLD LE  2)) OR +
   (&PDINUM EQ TSS0550 AND (&FLD GE  1 AND &FLD LE 60)) OR +
   (&PDINUM EQ TSS0680 AND (&FLD GE  1 AND &FLD LE 60)) OR +
   (&PDINUM EQ TSS0560 AND (&FLD GE 10 AND &FLD LE 64)) OR +
   (&PDINUM EQ TSS0690 AND (&FLD GE 10 AND &FLD LE 64)) OR +
   (&PDINUM EQ TSS0650 AND (&FLD GE  1 AND &FLD LE 30)) THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0390: +
IF &NRSTR(&PDINUM) NE TSS0460 THEN +
  GOTO BYPASS_TSS0460
 
IF &FINDRC EQ 0 THEN +
  GOTO NOT_A_FINDING
 
IF &SYSINDEX(&STR(IMPL),&NRSTR(&PDITEXT)) GT 1 THEN DO
  SET AC = &STR(Not Reviewed)
  ISREDIT LINE_AFTER .ZLAST = DATALINE (AC)
  END
 
GOTO A_FINDING
 
 
BYPASS_TSS0460: +
IF &NRSTR(&PDINUM) NE TSS0480 THEN +
  GOTO BYPASS_TSS0480
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(&STR(MIN=),&NRSTR(&PDITEXT)) + 4
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET MIN = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET S1 = &SYSINDEX(&STR(WARN=),&NRSTR(&PDITEXT)) + 5
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET WARN = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET S1 = &SYSINDEX(&STR(MINDAYS=),&NRSTR(&PDITEXT)) + 8
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET MINDAYS = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET S1 = &SYSINDEX(&STR(NR=),&NRSTR(&PDITEXT)) + 3
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET NR = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET ID = &SYSINDEX(&STR(,ID),&NRSTR(&PDITEXT))
SET TS = &SYSINDEX(&STR(,TS),&NRSTR(&PDITEXT))
SET RS = &SYSINDEX(&STR(,RS),&NRSTR(&PDITEXT))
SET SC = &SYSINDEX(&STR(,SC),&NRSTR(&PDITEXT))
SET SW = &SYSINDEX(&STR(,SW),&NRSTR(&PDITEXT))
SET FA = &SYSINDEX(&STR(,FA),&NRSTR(&PDITEXT))
SET FN = &SYSINDEX(&STR(,FN),&NRSTR(&PDITEXT))
SET MC = &SYSINDEX(&STR(,MC),&NRSTR(&PDITEXT))
SET LC = &SYSINDEX(&STR(,LC),&NRSTR(&PDITEXT))
SET UC = &SYSINDEX(&STR(,UC),&NRSTR(&PDITEXT))
/* PASSCHAR tests
SET PASSCHAR = &SYSINDEX(&STR(PASSCHAR),&NRSTR(&PDITEXT))
SET PWCHAR = &STR()
IF &PASSCHAR GT 0 THEN DO
  SET Y = &SYSINDEX(&STR(&RP),&NRSTR(&PDITEXT),&PASSCHAR)
  IF &PASSCHAR+10 LE &Y THEN +
    SET PWCHAR = &SUBSTR(&PASSCHAR+9:&Y-1,&NRSTR(&PDITEXT))&STR(,)
  END
SET MPWCHAR = &STR()
SET TPASSCHAR = &NRSTR(@,#,$,&&,*,^,:,=,!,-,%,.,?,_,|,)
SET TPASSCHAR = &STR(&TPASSCHAR)
DO X = 1 TO &LENGTH(&NRSTR(&TPASSCHAR)) BY 2
  SET T = &SUBSTR(&X:&X+1,&NRSTR(&TPASSCHAR))
  IF &SYSINDEX(&NRSTR(&T),&NRSTR(&PWCHAR)) EQ 0 THEN +
    SET MPWCHAR = &NRSTR(&MPWCHAR)&NRSTR(&T)
  END
IF &LENGTH(&NRSTR(&MPWCHAR)) GT 1 THEN DO
  SET X = &LENGTH(&NRSTR(&MPWCHAR)) - 1
  SET MPWCHAR = &SUBSTR(1:&X,&NRSTR(&MPWCHAR))
  END
 
WRITE &PGMNAME PWCHAR:<&NRSTR(&PWCHAR)> TPASSCHAR:+
  <&NRSTR(&TPASSCHAR)> MPWCHAR:<&NRSTR(&MPWCHAR)>
IF &PASSCHAR EQ 0 THEN DO
  WRITE &PGMNAME PASSCHAR is not specified.
  SET PDITEXT = &STR(&SUBSTR(1:&XL,&NRSTR(&PDITEXT))+
    ~ PASSCHAR()<)
  SET PASSCHAR = &SYSINDEX(&STR(PASSCHAR),&NRSTR(&PDITEXT))
  SET XL = &SYSINDEX(&STR(<),&NRSTR(&PDITEXT),&XF) - 1
  END
ELSE +
  WRITE &PGMNAME &SUBSTR(&PASSCHAR:&Y,&NRSTR(&PDITEXT))
 
SET AT = &SYSINDEX(&STR(@),&NRSTR(&PDITEXT))
SET LB = &SYSINDEX(&STR(#),&NRSTR(&PDITEXT))
SET DL = &SYSINDEX(&STR($),&NRSTR(&PDITEXT))
 
IF &MIN  EQ 8      AND +
   &WARN GE 1      AND +
   &WARN LE 10     AND +
   &MINDAYS EQ 1   AND +
   &NR EQ 0        AND +
   &ID GT 0        AND +
   &TS GT 0        AND +
   &RS GT 0        AND +
   &FA GT 0        AND +
   &FN GT 0        AND +
   &MC GT 0        AND +
   &LC GT 0        AND +
   &UC GT 0        AND +
   &SC GT 0        AND +
   &PASSCHAR GT 0  AND +
   &LENGTH(&NRSTR(&MPWCHAR)) EQ 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
IF &MIN  EQ 8      AND +
   &WARN GE 1      AND +
   &WARN LE 10     AND +
   &MINDAYS EQ 1   AND +
   &NR EQ 0        AND +
   &ID GT 0        AND +
   &TS GT 0        AND +
   &RS GT 0        AND +
   &FA GT 0        AND +
   &FN GT 0        AND +
   &MC GT 0        AND +
   &LC GT 0        AND +
   &UC GT 0        AND +
   &SC GT 0        AND +
   &PASSCHAR GT 0  AND +
   &AT GT 0        AND +
   &LB GT 0        AND +
   &DL GT 0        THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0480: +
IF &NRSTR(&PDINUM) NE TSS0485 THEN +
  GOTO BYPASS_TSS0485
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
 
IF &SYSINDEX(&LP&STR(128)&RP,&NRSTR(&PDITEXT)) GT 0 OR +
   &SYSINDEX(&LP&STR(256)&RP,&NRSTR(&PDITEXT)) GT 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0485: +
IF &NRSTR(&PDINUM) NE TSS0580 THEN +
  GOTO BYPASS_TSS0580
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET MIN = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
SET S1 = &SYSINDEX(&STR(%),&NRSTR(&MIN))
 
IF &S1 GT 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0580: +
IF &NRSTR(&PDINUM) NE TSS0660 THEN +
  GOTO BYPASS_TSS0660
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) - 1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET NEWPHRASE = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  SET NEWPHRASE = &STR(MA=0,MN=0,MAX=100,MIN=9,MINDAYS=0,NR=0,+
    SC=0,WARN=3)
SET NEWPHRASE = &NRSTR(&NEWPHRASE&STR(,))
 
SET MA = 0
SET S1 = &SYSINDEX(&STR(MA=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+3 LE &E1 THEN +
  SET MA = &SUBSTR(&S1+3:&E1,&NRSTR(&NEWPHRASE))
 
SET MN = 0
SET S1 = &SYSINDEX(&STR(MN=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+3 LE &E1 THEN +
  SET MN = &SUBSTR(&S1+3:&E1,&NRSTR(&NEWPHRASE))
 
SET MAX = 100
SET S1 = &SYSINDEX(&STR(MAX=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+4 LE &E1 THEN +
  SET MAX = &SUBSTR(&S1+4:&E1,&NRSTR(&NEWPHRASE))
 
SET MIN = 9
SET S1 = &SYSINDEX(&STR(MIN=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+4 LE &E1 THEN +
  SET MIN = &SUBSTR(&S1+4:&E1,&NRSTR(&NEWPHRASE))
 
SET MINDAYS = 0
SET S1 = &SYSINDEX(&STR(MINDAYS=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+8 LE &E1 THEN +
  SET MINDAYS = &SUBSTR(&S1+8:&E1,&NRSTR(&NEWPHRASE))
 
SET NR = 0
SET S1 = &SYSINDEX(&STR(NR=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+3 LE &E1 THEN +
  SET NR = &SUBSTR(&S1+3:&E1,&NRSTR(&NEWPHRASE))
 
SET SC = 0
SET S1 = &SYSINDEX(&STR(SC=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+3 LE &E1 THEN +
  SET SC = &SUBSTR(&S1+3:&E1,&NRSTR(&NEWPHRASE))
 
SET WARN = 3
SET S1 = &SYSINDEX(&STR(WARN=),&NRSTR(&NEWPHRASE))
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&NEWPHRASE),&S1) - 1
IF &S1 GT 0 AND &S1+5 LE &E1 THEN +
  SET WARN = &SUBSTR(&S1+5:&E1,&NRSTR(&NEWPHRASE))
 
 
SET ID = &SYSINDEX(&STR(,ID),&NRSTR(&NEWPHRASE))
/* PPSCHAR tests
SET PPSCHAR = &SYSINDEX(&STR(PPSCHAR),&NRSTR(&PDITEXT))
SET AT = &SYSINDEX(&STR(@),&NRSTR(&PDITEXT),&PPSCHAR)
SET LB = &SYSINDEX(&STR(#),&NRSTR(&PDITEXT),&PPSCHAR)
SET DL = &SYSINDEX(&STR($),&NRSTR(&PDITEXT),&PPSCHAR)
SET SP = &SYSINDEX(&STR(, ),&NRSTR(&PDITEXT),&PPSCHAR)
IF &SP EQ 0 THEN +
  SET SP = &SYSINDEX(&STR( ,),&NRSTR(&PDITEXT),&PPSCHAR)
SET ATH = &SYSINDEX(&STR(7C),&NRSTR(&PDITEXT),&PPSCHAR)
SET LBH = &SYSINDEX(&STR(7B),&NRSTR(&PDITEXT),&PPSCHAR)
SET DLH = &SYSINDEX(&STR(5B),&NRSTR(&PDITEXT),&PPSCHAR)
SET SPH = &SYSINDEX(&STR(40),&NRSTR(&PDITEXT),&PPSCHAR)
 
/* PPSCHAR tests
SET PPSCHAR = &SYSINDEX(&STR(PPSCHAR),&NRSTR(&PDITEXT))
SET PWCHAR = &STR()
IF &PPSCHAR GT 0 THEN DO
  SET Y = &SYSINDEX(&STR(&RP),&NRSTR(&PDITEXT),&PPSCHAR)
  IF &PPSCHAR+9 LE &Y THEN +
    SET PWCHAR = &SUBSTR(&PPSCHAR+8:&Y-1,&NRSTR(&PDITEXT))&STR(,)
  END
ELSE DO
  SET PWCHAR = &STR()
  END
SET MPWCHAR = &STR()
SET TPASSCHAR = &NRSTR( ,@,#,$,&&,*,^,:,=,!,-,%,.,?,_,|,)
SET TPASSCHAR = &STR(&TPASSCHAR)
DO X = 1 TO &LENGTH(&NRSTR(&TPASSCHAR)) BY 2
  SET T = &SUBSTR(&X:&X+1,&NRSTR(&TPASSCHAR))
  IF &SYSINDEX(&NRSTR(&T),&NRSTR(&PWCHAR)) EQ 0 THEN +
    SET MPWCHAR = &NRSTR(&MPWCHAR)&NRSTR(&T)
  END
IF &LENGTH(&NRSTR(&MPWCHAR)) GT 1 THEN DO
  SET X = &LENGTH(&NRSTR(&MPWCHAR)) - 1
  SET MPWCHAR = &SUBSTR(1:&X,&NRSTR(&MPWCHAR))
  END
 
WRITE &PGMNAME PWCHAR:<&NRSTR(&PWCHAR)> TPASSCHAR:+
  <&NRSTR(&TPASSCHAR)> MPWCHAR:<&NRSTR(&MPWCHAR)>
IF &PPSCHAR EQ 0 THEN DO
  WRITE &PGMNAME PPSCHAR is not specified.
  SET PDITEXT = &STR(&SUBSTR(1:&XL,&NRSTR(&PDITEXT))+
    ~ PPSCHAR()<)
  SET PPSCHAR = &SYSINDEX(&STR(PPSCHAR),&NRSTR(&PDITEXT))
  SET Y = &SYSINDEX(&STR(&RP),&NRSTR(&PDITEXT),&PPSCHAR)
  SET XL = &SYSINDEX(&STR(<),&NRSTR(&PDITEXT),&XF) - 1
  END
ELSE +
  WRITE &PGMNAME &SUBSTR(&PPSCHAR:&Y,&NRSTR(&PDITEXT))
 
IF &MA      GE 1      AND +
   &MN      GE 1      AND +
   &MAX     EQ 100    AND +
   &MIN     GE 15     AND +
   &MINDAYS EQ 1      AND +
   &SC      GE 1      AND +
   &WARN    GE 1      AND +
   &WARN    LE 10     AND +
   &PPSCHAR GT 0      AND +
   &LENGTH(&NRSTR(&MPWCHAR)) EQ 0 THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
IF &MA      GE 1      AND +
   &MN      GE 1      AND +
   &ID      GT 1      AND +
   &MAX     EQ 100    AND +
   &MIN     GE 15     AND +
   &MINDAYS EQ 1      AND +
   &NR      GE 0      AND +
   &NR      LE 1      AND +
   &SC      GE 1      AND +
   &WARN    GE 1      AND +
   &WARN    LE 10     AND +
   &PPSCHAR GT 0      AND +
   (&SP      GT 0      OR +
    &SPH     GT 0)     AND +
   (&AT      GT 0      OR +
    &ATH     GT 0)     AND +
   (&LB      GT 0      OR +
    &LBH     GT 0)     AND +
   (&DL      GT 0      OR +
    &DLH     GT 0)     THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0660: +
IF &NRSTR(&PDINUM) NE TSS0730 THEN +
  GOTO BYPASS_TSS0730
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(&LP,&NRSTR(&PDITEXT)) + 1
SET E1 = &SYSINDEX(&STR(,),&NRSTR(&PDITEXT),&S1) -1
 
IF &E1 LT &S1 THEN +
  SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1) -1
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET VIO = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
IF &DATATYPE(&VIO) NE &STR(NUM) THEN +
  GOTO A_FINDING
 
SET NOT = &SYSINDEX(&STR(,NOT),&NRSTR(&PDITEXT))
SET CAN = &SYSINDEX(&STR(,CAN),&NRSTR(&PDITEXT))
SET SUS = &SYSINDEX(&STR(,SUS),&NRSTR(&PDITEXT))
 
IF (&VIO GE 1 AND &VIO LE 10) AND +
    &NOT GT 0 AND +
   (&CAN GT 0 OR &SUS GT 0) THEN +
  GOTO NOT_A_FINDING
 
GOTO A_FINDING
 
 
BYPASS_TSS0730: +
IF &NRSTR(&PDINUM) NE ZUSST050 THEN +
  GOTO BYPASS_ZUSST050
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
ISPEXEC VGET ( +
  CLASS        +
  ) ASIS
 
IF &CLASS EQ 2 THEN +
  GOTO NOT_APPLICABLE
 
SET UNIQUSER =
SET S1 = &SYSINDEX(UNIQUSER,&NRSTR(&PDITEXT))
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1+1)
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET UNIQUSER = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
IF &SYSINDEX(&STR(UNIQUSER&LP.OFF&RP),&NRSTR(&UNIQUSER)) GT 0 THEN +
  GOTO NOT_A_FINDING
 
SET AC = &STR(Not Reviewed)
ISREDIT LINE_AFTER .ZLAST = DATALINE (AC)
 
SET AC = &STR(The following Control Option value(s) is (are) +
  improperly set:)
ISREDIT LINE_AFTER .ZLAST = (AC)
 
SET AC = &STR( )
ISREDIT LINE_AFTER .ZLAST = (AC)
 
SET AC = &NRSTR(     &UNIQUSER)
ISREDIT LINE_AFTER .ZLAST = (AC)
 
GOTO STIG_REQ
 
 
BYPASS_ZUSST050: +
IF &NRSTR(&PDINUM) NE ZUSST052 THEN +
  GOTO BYPASS_ZUSST052
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET OMVSUSR =
SET S1 = &SYSINDEX(CHOWN_RESTRICTED,&NRSTR(&PDITEXT))
SET E1 = &SYSINDEX(&STR( ),&NRSTR(&PDITEXT),&S1+1)
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  GOTO NOT_APPLICABLE
 
SET CHOWN =
SET S1 = &SYSINDEX(CHOWNURS&LP,&NRSTR(&PDITEXT))
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1+1)
 
IF &S1 GT 0 AND &S1 LE &E1 THEN +
  SET CHOWN = &SUBSTR(&S1:&E1,&NRSTR(&PDITEXT))
ELSE +
  GOTO A_FINDING
 
IF &SYSINDEX(&STR(CHOWNURS&LP.OFF&RP),&NRSTR(&CHOWN)) GT 0 THEN +
  GOTO NOT_A_FINDING
 
SET AC = &STR(The following Control Option value(s) is (are) +
  improperly set:)
ISREDIT LINE_AFTER .ZLAST = (AC)
 
SET AC = &STR( )
ISREDIT LINE_AFTER .ZLAST = (AC)
 
SET AC = &NRSTR(     &CHOWN)
ISREDIT LINE_AFTER .ZLAST = (AC)
 
GOTO STIG_REQ
 
 
BYPASS_ZUSST052: +
IF &NRSTR(&PDINUM) NE ZUSST060 THEN +
  GOTO BYPASS_ZUSST060
 
IF &XF EQ 1 THEN +
  GOTO NOT_FOUND
 
SET S1 = &SYSINDEX(HFSSEC,&NRSTR(&PDITEXT))
SET E1 = &SYSINDEX(&RP,&NRSTR(&PDITEXT),&S1+1)
 
IF &SYSINDEX(&STR(HFSSEC(OFF)),&NRSTR(&PDITEXT)) GT 0 THEN +
  GOTO NOT_APPLICABLE
 
SET SYSOUTTRAP = 99999
 
SET CMD = &STR(TSS LIST(RDT) RESCLASS(HFSSEC))
&CMD
 
SET CNT = &SYSOUTLINE
DO X = 1 TO &CNT
  SET AB  = &&SYSOUTLINE&X             /* set variable
  SET AB  = &SYSNSUB(2,&AB)            /* set value with limits
  IF &SUBSTR(1:12,&NRSTR(&AB)) NE &STR(ACCESSORID =) AND +
     &NRSTR(&AB)               NE &STR( ) AND +
     &SUBSTR(1:3,&NRSTR(&AB))  NE &STR(TSS) THEN DO
    SET AB  = &STR(   &AB)
    ISREDIT LINE_AFTER .ZLAST = (AB)
    END
END
 
ISREDIT EXCLUDE ALL '=' 21
 
SET RETURN_CODE = 0
DO UNTIL &RETURN_CODE GT 0
  ISREDIT FIND ' ' 1 NX FIRST
  IF &RETURN_CODE EQ 0 THEN DO
    ISREDIT (ROW) = LINENUM .ZCSR
    SET ROW1 = &ROW - 1
    ISREDIT (AC1) = LINE &ROW
    ISREDIT (AC) = LINE &ROW1
    SET Y = &LENGTH(&NRSTR(&AC))
    DO X = &Y TO 5 BY -1 +
      UNTIL &SUBSTR(&X,&NRSTR(&AC)) NE &STR( )
    END
    SET AC = &SUBSTR(1:&X,&NRSTR(&AC))
    SET Y = &LENGTH(&NRSTR(&AC1))
    DO X = &Y TO 5 BY -1 +
      UNTIL &SUBSTR(&X,&NRSTR(&AC1)) NE &STR( )
    END
    SET AC1 = &SUBSTR(1:&X,&NRSTR(&AC1))
    SET Y = &LENGTH(&NRSTR(&AC1))
    DO X = 1 TO &Y +
      UNTIL &SUBSTR(&X,&NRSTR(&AC1)) NE &STR( )
    END
    SET AC1 = &SUBSTR(&X:&Y,&NRSTR(&AC1))
    SET AC = &NRSTR(&AC.&AC1)
    ISREDIT DELETE &ROW
    ISREDIT LINE &ROW1 = (AC)
    END
END
 
SET AC = &STR( )
ISREDIT LINE_BEFORE .ZFIRST = (AC)
 
SET RETURN_CODE = 0
ISREDIT FIND 'DEFPROT' ALL
 
IF &RETURN_CODE GT 0 THEN +
  SET AC = &STR(The HFSSEC resource class is not defined with +
    DEFPROT.)
ELSE DO
  SET AC = &STR(The HFSSEC resource class has DEFPROT specified.)
  ISREDIT LINE_BEFORE .ZFIRST = (AC)
  SET AC = &STR(Not a Finding)
  END
 
ISREDIT LINE_BEFORE .ZFIRST = (AC)
 
SET AC = &STR( )
ISREDIT LINE_AFTER .ZLAST = (AC)
 
GOTO STIG_REQ
 
 
BYPASS_ZUSST060: +
GOTO END_EDIT
 
NOT_APPLICABLE: +
SET AC = &STR(Not Applicable)
 
ISREDIT LINE_AFTER .ZLAST = (AC)
ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
 
IF &NRSTR(&PDINUM) EQ ZUSST060 THEN +
  SET AC = &STR(     HFSSEC(OFF) specified.)
ELSE +
  SET AC = &STR(     Top Secret Version &ACPVERS)
ISREDIT LINE_AFTER .ZLAST = (AC)
ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
 
IF &XF GT 0 AND &XF LE &XL THEN DO
  SET X = &SYSINDEX(&STR(~),&STR(&SUBSTR(1:&XL,+
    &NRSTR(&PDITEXT))~),&XF)
  IF &X EQ 0 THEN SET X = &XL + 1
  DO WHILE &X GT 2
    IF &STR(&SUBSTR(&XF:&XF,&NRSTR(&PDITEXT))) EQ &STR( ) THEN +
      SET XF = &XF + 1
    SET AC = &STR(     &SUBSTR(&XF:&X-1,&NRSTR(&PDITEXT)))
    ISREDIT LINE_AFTER .ZLAST = DATALINE (AC)
    SET XF = &X + 1
    SET X = &SYSINDEX(&STR(~),&STR(&SUBSTR(1:&XL,+
      &NRSTR(&PDITEXT))~),&XF)
    END
  END
 
GOTO STIG_REQ
 
A_FINDING: +
SET AC = &STR(The following Control Option value is improperly +
   set:)
ISREDIT LINE_AFTER .ZLAST = (AC)
ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
 
IF &XF GT 0 AND &XF LE &XL THEN DO
  SET X = &SYSINDEX(&STR(~),&STR(&SUBSTR(1:&XL,+
    &NRSTR(&PDITEXT))~),&XF)
  IF &X EQ 0 THEN SET X = &XL + 1
  DO WHILE &X GT 2
    IF &STR(&SUBSTR(&XF:&XF,&NRSTR(&PDITEXT))) EQ &STR( ) THEN +
      SET XF = &XF + 1
    SET AC = &STR(     &SUBSTR(&XF:&X-1,&NRSTR(&PDITEXT)))
    ISREDIT LINE_AFTER .ZLAST = DATALINE (AC)
    SET XF = &X + 1
    SET X = &SYSINDEX(&STR(~),&STR(&SUBSTR(1:&XL,+
      &NRSTR(&PDITEXT))~),&XF)
    END
  END
 
STIG_REQ: +
SET RETURN_CODE = 0
 
IF &NRSTR(&TYPERUN) NE SRRAUDIT THEN +
  GOTO END_EDIT
 
  ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
  SET &ZF = 1
  SET &ZL = &LENGTH(&NRSTR(&DISATXT))
  SET &Z = &SYSINDEX(&STR(~),&NRSTR(&DISATXT))
  DO WHILE &Z GT &ZF
    SET AC = &STR(DISA recommendation: &SUBSTR(&ZF:&Z-1,&NRSTR(&DISATXT)))
    ISREDIT LINE_AFTER .ZLAST = (AC)
    SET &ZF = &Z + 1
    SET &Z = &SYSINDEX(&STR(~),&NRSTR(&DISATXT),&ZF)
    END
 
  IF &ZL GT &ZF THEN DO
    SET AC = &STR(DISA recommendation: &SUBSTR(&ZF:&ZL,&STR(&DISATXT)))
    ISREDIT LINE_AFTER .ZLAST = (AC)
    END
 
GOTO END_EDIT
 
NOT_FOUND: +
SET RETURN_CODE = 0
 
SET AC = &STR(The following Control Option value is improperly +
    set:)
ISREDIT LINE_AFTER .ZLAST = (AC)
ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
 
IF &XF LT 4 THEN +
  SET AC = &STR(     &SUBSTR(2:&XL,&NRSTR(&PDITEXT)))
ELSE +
  SET AC = &STR(     &SUBSTR(2:&XF-2,&NRSTR(&PDITEXT)))
 
ISREDIT LINE_AFTER .ZLAST = (AC)
ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
 
IF &NRSTR(&TYPERUN) NE SRRAUDIT THEN +
  GOTO END_EDIT
 
SET &Z = &SYSINDEX(&STR(~),&NRSTR(&FINDTXT8))
DO WHILE &Z GT 0
  SET &ZL = &LENGTH(&NRSTR(&FINDTXT8))
  IF &Z EQ 1 THEN +
    SET FINDTXT8 = &SUBSTR(2:&ZL,&NRSTR(&FINDTXT8))
  ELSE +
    IF &Z+1 LT &ZL THEN +
      SET FINDTXT8 = &SUBSTR(1:&Z-1,&NRSTR(&FINDTXT8)) +
                     &SUBSTR(&Z+1:&ZL,&NRSTR(&FINDTXT8))
    ELSE +
      SET FINDTXT8 = &SUBSTR(1:&ZL-1,&NRSTR(&FINDTXT8))
  SET &Z = &SYSINDEX(&STR(~),&NRSTR(&FINDTXT8))
  END
 
SET &Z = &SYSINDEX(&STR('),&NRSTR(&FINDTXT8))
DO WHILE &Z GT 0
  SET &ZL = &LENGTH(&NRSTR(&FINDTXT8))
  IF &Z EQ 1 THEN +
    SET FINDTXT8 = &SUBSTR(2:&ZL,&NRSTR(&FINDTXT8))
  ELSE +
    IF &Z+1 LT &ZL THEN +
      SET FINDTXT8 = &SUBSTR(1:&Z-1,&NRSTR(&FINDTXT8)) +
                     &SUBSTR(&Z+1:&ZL,&NRSTR(&FINDTXT8))
    ELSE +
      SET FINDTXT8 = &SUBSTR(1:&ZL-1,&NRSTR(&FINDTXT8))
  SET &Z = &SYSINDEX(&STR('),&NRSTR(&FINDTXT8))
  END
 
SET &Z = &SYSINDEX(&STR(.ZCSR),&NRSTR(&FINDTXT8))
DO WHILE &Z GT 0
  SET &ZL = &LENGTH(&NRSTR(&FINDTXT8))
  IF &Z EQ 1 THEN +
    SET FINDTXT8 = &SUBSTR(6:&ZL,&NRSTR(&FINDTXT8))
  ELSE +
    IF &Z+5 LT &ZL THEN +
      SET FINDTXT8 = &SUBSTR(1:&Z-1,&NRSTR(&FINDTXT8)) +
                     &SUBSTR(&Z+5:&ZL,&NRSTR(&FINDTXT8))
    ELSE +
      SET FINDTXT8 = &SUBSTR(1:&Z-1,&NRSTR(&FINDTXT8))
  SET &Z = &SYSINDEX(&STR(.ZCSR),&NRSTR(&FINDTXT8))
  END
 
SET &Z = &SYSINDEX(&STR(    ),&NRSTR(&FINDTXT8))
DO WHILE &Z GT 0
  SET &ZL = &LENGTH(&NRSTR(&FINDTXT8))
  IF &Z+4 LT &ZL THEN DO
    SET &FINDTXT8 = &SUBSTR(1:&Z-1,&NRSTR(&FINDTXT8)) +
                   &SUBSTR(&Z+4:&ZL,&NRSTR(&FINDTXT8))
    SET &Z = &SYSINDEX(&STR(    ),&NRSTR(&FINDTXT8))
    END
  ELSE SET &Z = 0
  END
 
SET AC = &NRSTR(     &FINDTXT8 - Text not found)
ISREDIT LINE_AFTER .ZLAST = (AC)
ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
 
GOTO STIG_REQ
 
 
NOT_A_FINDING_MPARTS: +
  SET &X = &SYSINDEX(&STR(~),&NRSTR(&PDITEXT),&XF)
  DO WHILE &X GT 2
    SET &PDITEXT = &SUBSTR(1:&X-1,&NRSTR(&PDITEXT)) +
                   &SUBSTR(&X+1:&XL,&NRSTR(&PDITEXT))
    SET &XL = &LENGTH(&NRSTR(&PDITEXT))
    SET &X = &SYSINDEX(&STR(~),&NRSTR(&PDITEXT),&X)
    END
 
  SET &X = &SYSINDEX(&STR(    ),&NRSTR(&PDITEXT),&XF)
  DO WHILE &X GT 2
    IF &X+4 LT &XL THEN DO
      SET &PDITEXT = &SUBSTR(1:&X-1,&NRSTR(&PDITEXT)) +
                     &SUBSTR(&X+4:&XL,&NRSTR(&PDITEXT))
      SET &XL = &LENGTH(&NRSTR(&PDITEXT))
      SET &X = &SYSINDEX(&STR(    ),&NRSTR(&PDITEXT),&XF)
      END
    ELSE SET &X = 0
    END
 
 
NOT_A_FINDING: +
  SET AC = &STR(Not a Finding)
  ISREDIT LINE_AFTER .ZLAST = (AC)
  ISREDIT LINE_AFTER .ZLAST = DATALINE ' '
 
IF &XF GT 0 AND &XF LE &XL THEN DO
  SET X = &SYSINDEX(&STR(~),&STR(&SUBSTR(1:&XL,+
    &NRSTR(&PDITEXT))~),&XF)
  IF &X EQ 0 THEN SET X = &XL + 1
  DO WHILE &X GT 2
    IF &STR(&SUBSTR(&XF:&XF,&NRSTR(&PDITEXT))) EQ &STR( ) THEN +
      SET XF = &XF + 1
    SET AC = &STR(     &SUBSTR(&XF:&X-1,&NRSTR(&PDITEXT)))
    ISREDIT LINE_AFTER .ZLAST = DATALINE (AC)
    SET XF = &X + 1
    SET X = &SYSINDEX(&STR(~),&STR(&SUBSTR(1:&XL,+
      &NRSTR(&PDITEXT))~),&XF)
    END
  END
 
END_EDIT: +
SET RETURN_CODE = 0
 
ERR_EXIT: +
IF &MAXCC GE 16 OR +
   &RETURN_CODE GT 0 THEN DO
  ISPEXEC VGET (ZISPFRC) SHARED
  IF &MAXCC GT &ZISPFRC THEN +
    SET ZISPFRC = &MAXCC
  ELSE +
    SET ZISPFRC = &RETURN_CODE
  ISPEXEC VPUT (ZISPFRC) SHARED
  WRITE &PGMNAME ZISPFRC = &ZISPFRC
  END
 
SET TM00ARC = &RETURN_CODE
 
ISPEXEC VPUT ( +
  TM0AVGET     +
  TM00ARC      +
  ) ASIS
 
ISREDIT SAVE
ISREDIT END
 
EXIT CODE(0)
ISREDIT MEND
