ISREDIT MACRO       /* CARM0422 EDIT SENSITVE(rpt*)  */
 
/* 01/20/2005 JL.NELSON Created to copy dsnames into PDI
/* 02/25/2005 JL.NELSON Changed constants to variables
/* 06/09/2005 JL.NELSON Pass MAXCC in ZISPFRC variable
 
SET PGMNAME = &STR(CARM0422 09/30/07)
 
SET SYSPROMPT = OFF                /* CONTROL NOPROMPT          */
SET SYSFLUSH  = OFF                /* CONTROL NOFLUSH           */
SET SYSASIS   = ON                 /* CONTROL ASIS - caps off   */
 
/* 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                                */
/* *************************************** */
 
SET RETURN_CODE = 0
 
ISPEXEC VGET ( +
  CONSLIST     +
  COMLIST      +
  SYMLIST      +
  TERMMSGS     +
  PDIDD        +
  DSRULE       +
  OMEMBER      +
  ) ASIS
 
SET RM22VGET = &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 PDIDD/&PDIDD DSRULE/&DSRULE OMEMBER/&OMEMBER
  SET RETURN_CODE = &RETURN_CODE + 16
  GOTO ERR_EXIT
  END
 
SET RETURN_CODE = 0
 
/* *************************************** */
/* 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         */
 
ISREDIT (MEMBER) = MEMBER
ISREDIT (DSNAME) = DATASET
 
ISREDIT (ENDER) = LINENUM .ZLAST
 
SET BLANK = &STR( )
 
SET LP = &STR((
SET RP = )
 
SET RETURN_CODE = 0
 
ISREDIT CURSOR = 1 0
 
ISREDIT FIND '&DSRULE'  1
 
IF &RETURN_CODE NE 0 THEN +
  GOTO END_EDIT
 
ISREDIT (CURLINE) = LINENUM .ZCSR
 
DSN_LOOP: +
SET RETURN_CODE = 0
 
SET CURLINE = &CURLINE + 1
 
ISREDIT (DATA) = LINE &CURLINE
 
IF &STR( ) EQ &SUBSTR(3,&STR(&DATA)) THEN +
  GOTO END_EDIT
 
SET RETURN_CODE = 0
 
ISPEXEC LMPUT DATAID(&PDIDD) MODE(INVAR) DATALOC(DATA) +
    DATALEN(&LENGTH(&NRSTR(&DATA))) MEMBER(&OMEMBER)
 
IF &RETURN_CODE NE 0 THEN DO
  WRITE &PGMNAME LMPUT_PDIDD_RC = &RETURN_CODE  &ZERRSM
  GOTO ERR_EDIT
  END
 
GOTO DSN_LOOP
 
 
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 RM422RC = &RETURN_CODE
 
ISPEXEC VPUT ( +
  RM22VGET     +
  RM422RC      +
  ) ASIS
 
ISREDIT END
 
EXIT CODE(0)
ISREDIT MEND
