MACRO 00001000 SYSID &DEFAULT= 00002000 .* 00003000 .*--------------------------------------------------------------------- 00004000 .* This macro generates the SYSID list 00005000 .*--------------------------------------------------------------------- 00006000 .* 00007000 GBLC &SY$ID SYSID invoked indicator 00008000 LCLC &DEFSID Default SYSID 00009000 &DEFSID SETC ' ' Make default SYSID blank 00010000 .* 00011000 .*--------------------------------------------------------------------- 00012000 .* Make sure that the SYSID macro is only invoked once. 00013000 .*--------------------------------------------------------------------- 00014000 .* 00015000 AIF ('&SY$ID' EQ 'HERE').DUP 00016000 &SY$ID SETC 'HERE' Indicate SYSID Invoked 00017000 GBLA &SIDCNT 00018000 LCLC &SYSNAM,&SYSMOD,&SYSSER 00019000 LCLA &INDEX 00020000 &INDEX SETA 1 00021000 &SIDCNT SETA N'&SYSLIST 00022000 SPACE 1 00023000 .* 00024000 .*--------------------------------------------------------------------- 00025000 .* Build the SYSID list, if specified 00026000 .*--------------------------------------------------------------------- 00027000 .* 00028000 ENTRY DMKSYSIC,DMKSYSIL,DMKSYSID 00029000 DMKSYSIC DC F'&SIDCNT' 00030000 DMKSYSIL DS 0F 00031000 .LOOP AIF (&INDEX GT &SIDCNT).LSTFIN 00032000 AIF (&INDEX GT 255).TOOMANY 00033000 AIF (N'&SYSLIST(&INDEX) LT 3).BADCNT 00034000 AIF (N'&SYSLIST(&INDEX) GT 3).BADCNT 00035000 &SYSNAM SETC '&SYSLIST(&INDEX,1)' 00036000 &SYSMOD SETC '&SYSLIST(&INDEX,2)' 00037000 &SYSSER SETC '&SYSLIST(&INDEX,3)' 00038000 AIF (K'&SYSNAM LT 1).BADNAM 00039000 AIF (K'&SYSNAM GT 8).BADNAM 00040000 AIF (K'&SYSMOD LT 3).BADMOD 00041000 AIF (K'&SYSMOD EQ 4).SKIPMOD 00042000 AIF (K'&SYSMOD GT 4).BADMOD 00043000 &SYSMOD SETC '0&SYSMOD' 00044000 .SKIPMOD ANOP 00045000 AIF (K'&SYSSER LT 5).BADSER 00046000 AIF (K'&SYSSER EQ 6).SKIPSER 00047000 AIF (K'&SYSSER GT 6).BADSER 00048000 &SYSSER SETC '0&SYSSER' 00049000 .SKIPSER ANOP 00050000 DC CL8'&SYSNAM',XL1'00',XL3'&SYSSER',XL2'&SYSMOD' 00051000 .NEXT ANOP 00052000 &INDEX SETA &INDEX+1 00053000 AGO .LOOP 00054000 .* 00055000 .*--------------------------------------------------------------------- 00056000 .* Finished with the list. Now do the DEFAULT, if specified 00057000 .*--------------------------------------------------------------------- 00058000 .* 00059000 .LSTFIN AIF (N'&DEFAULT EQ 0).FINISH 00060000 AIF (N'&DEFAULT GT 1).MULDEF 00061000 AIF (K'&DEFAULT LT 1).BADDEF 00062000 AIF (K'&DEFAULT GT 8).BADDEF 00063000 &DEFSID SETC '&DEFAULT' 00064000 &SIDCNT SETA &SIDCNT+1 00065000 .* 00066000 .*--------------------------------------------------------------------- 00067000 .* Finally, store the default SYSID in DMKSYSID 00068000 .*--------------------------------------------------------------------- 00069000 .* 00070000 .FINISH ANOP 00071000 DMKSYSID DS 0D 00072000 DC CL8'&DEFSID' 00073000 AIF (&SIDCNT LE 0).NULL 00074000 SPACE 3 00075000 MEXIT 00076000 .* 00077000 .*--------------------------------------------------------------------- 00078000 .* Process errors 00079000 .*--------------------------------------------------------------------- 00080000 .* 00081000 .BADCNT MNOTE 8,'Specify (systemid, model, serial) per SYSID entry' 00082000 AGO .NEXT 00083000 .* 00084000 .BADNAM MNOTE 8,'Systemid ''&SYSNAM'' must be 1 to 8 characters long' 00085000 AGO .NEXT 00086000 .* 00087000 .BADMOD MNOTE 8,'Model ''&SYSMOD'' must be 3 or 4 digits' 00088000 AGO .NEXT 00089000 .* 00090000 .BADSER MNOTE 8,'Serial ''&SYSSER'' must be 5 or 6 digits' 00091000 AGO .NEXT 00092000 .* 00093000 .TOOMANY MNOTE 8,'More than 255 SYSID entries specified' 00094000 MEXIT 00095000 .* 00096000 .DUP MNOTE 8,'SYSID macro specified more than once' 00097000 MEXIT 00098000 .* 00099000 .BADDEF MNOTE 8,'SYSID DEFAULT ''&DEFAULT'' must be 1 to 8 characters' 00100000 AGO .FINISH 00101000 .* 00102000 .MULDEF MNOTE 8,'Specify only one value for SYSID DEFAULT' 00103000 AGO .FINISH 00104000 .* 00105000 .NULL MNOTE 8,'No SYSID entries specified' 00106000 MEND 00107000