Here's the code to set/display/change the access port name on a given device (provided that the UCB for said device is long enough to have a pointer to a potential access port name -- not all devices do). It needs CMKRNL to run. It's probably best to read the comments in the source code; briefly, here are the commands: ACCP> Set ACCP> Show ACCP> Help ACCP> Exit The parameter must be a terminal device (i.e., DC$_TERM). The parameter need not be enclosed in quotes -- it will show up exactly as you type it in the access port name field. Build this with: $ Macro ACCPORNAM $ Message ACCPORNAM_MSG $ Link/NoTrace ACCPORNAM+ACCPORNAM_MSG gkn Gerard K. Newman gkn@sdsc.edu 619.534.5076 San Diego Supercomputer Center gkn@sdsc.bitnet 619.534.5152 FAX PO Box 85608 sdsc::gkn (27.1/span) San Diego, CA 92186-9784 ucsd!gkn -------------------------------------------------------------------------------- $! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.1-004 3-AUG-1989 $! On 19-APR-1991 23:43:01.75 By user GKN $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $!+ THIS PACKAGE DISTRIBUTED IN 2 PARTS, TO KEEP EACH PART $! BELOW 30 BLOCKS $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. ACCPORNAM.MAR;8 $! 2. ACCPORNAM_MSG.MSG;3 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ if f$getsyi("version") .ges. "V4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$search(P1) .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete/nolog 'f'* $ exit $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete/nolog 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name"); buff:=CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(buff)) ;LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(buff));g:=0;LOOP EXITIF MARK(NONE)=END_OF(buff);x:= ERASE_CHARACTER(1);IF g = 0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x= "V" THEN APPEND_LINE;MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF; IF x="+" THEN g:=1;ERASE_LINE;ENDIF;ELSE IF x="-" THEN g:=0;ENDIF;ERASE_LINE; ENDIF;ENDLOOP;p:="`";POSITION(BEGINNING_OF(buff));LOOP r:=SEARCH(p,FORWARD); EXITIF r=0;POSITION(r);ERASE(r);COPY_TEXT(ASCII(INT(ERASE_CHARACTER(3)))); ENDLOOP;o:=GET_INFO(COMMAND_LINE,"output_file");WRITE_FILE(buff,o); ENDPROCEDURE;Unpacker;EXIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create/nolog 'f' X`009.Title`009ACCPORNAM`009- Set the Access Port Name for terminals X`009.Ident`009/V01.000/ X`009.Enable`009SUP X`009.Default Displacement,Word X`009.Subtitle`009Introduction X X;+ X; X; ----- ACCPORNAM: Set the Access Port Name for terminals X; X; X; Facility: X; X;`009VAX/VMS system management X; X; Abstract: X; X;`009This module allows a suitably privileged user to set the Access X;`009Port Name (ACCPORNAM) for hard-wired terminals. X; X; Environment: X; X;`009VAX/VMS native mode, VMS V5.0 or later, CMKRNL privilege. X; X; X; X; Version:`009V01.000 X; Date:`009`00924-Feb-1989 X; X; Copyright `169 1989 San Diego Supercomputer Center X; X; Gerard K. Newman`00924-Feb-1989 X; San Diego Supercomputer Center X; General Atomics X; P.O. Box 85608 X; San Diego, CA 92138-5608 X; 619.534.5076 X; X; Internet:`009GKN@SDS.SDSC.EDU X; BITNET:`009GKN@SDSC.BITNET X; SPAN:`009`009SDSC::GKN (27.1) X; MFENET:`009GKN@SDS.MFENET X; SDSCNET:`009GKN@SDS.SDSCNET X; X; X; Modifications: X; X; X;- X X`009.Page X`009.Subtitle`009Local definitions X X`009.Link`009 "SYS$SYSTEM:SYS.STB"/Selective_Search`009;Grab the system symb Vol table X`009.Library "SYS$LIBRARY:LIB.MLB"`009`009`009;Get special macros from here X X`009.NoCross`009`009`009;Save a tree X X`009$CHFDEF`009`009`009`009;Define condition handler stuff X`009$DCDEF`009`009`009`009;Device class & type definitions X`009$SSDEF`009`009`009`009;System service codes X`009$STSDEF`009`009`009`009;Define severity codes X`009$TPADEF`009`009`009`009;TPARSE definitions X`009$TTYUCBDEF`009`009`009;Terminal UCB offsets X`009$UCBDEF`009`009`009`009;UCB offsets X X`009.Cross`009`009`009`009;Turn CREF back on X X X; Local macros X X; Item:`009`009Make an item list entry for $GETxxI X X.Macro`009Item`009Type=DVI,Item=,Length=4,RetAdr=,RetLen= ;Make an item list V entry for $GETxxI X`009.Word`009Length,Type'$_'Item`009;Length,,what X`009.Address RetAdr`009`009`009;Put it here X`009.If`009NB,RetLen`009`009;If we have an explicit return length X`009.Address RetLen`009`009`009; then use it X`009.Iff`009`009`009`009; else X`009.Long`0090`009`009`009; we don't care X`009.Endc`009`009`009`009;`009... X.Endm`009Item`009`009`009`009;`009... X X; .Ascip:`009Create a pointer to an .Ascid string X X.Macro`009.Ascip`009STRING,?A`009`009;Point to a string descriptor in anothe Vr PSECT X`009.Enable`009LSB`009`009`009;Turn on the local symbol block X`009.Save`009`009`009`009;Save the current PSECT X`009.Psect`009STRINGS NOEXE,RD,NOWRT,PIC,SHR,PAGE XA:`009.Ascid`009\'STRING\`009`009;String X`009.Restore`009`009`009;Restore the current PSECT X`009.Address A`009`009`009;Store pointer to the string X`009.Disable LSB`009`009`009;Turn off the local symbol block X.Endm`009.Ascip`009`009`009`009; ... X X`009.Page X`009.Subtitle`009TPARSE state table X X;+ X; X; ----- TPARSE state table X; X; X; Valid commands: X; X;`009HELP or ?`009`009- Print a short help message X;`009SET `009- Set the ACCPORNAM for to X;`009SHOW `009`009- Show the ACCPORNAM for X;`009EXIT`009`009`009- Quit X; X;- X X`009$INIT_STATE`009ACCP_STATES,ACCP_KEYS`009;Initialize the state table X X; Parse the major verb. X X`009$STATE`009`009`009`009`009;First state X X`009$TRAN`009TPA$_STRING,,UPCASE`009`009;Upcase the first token (!) X`009$TRAN`009TPA$_EOS,TPA$_EXIT`009`009;Ignore empty commands X`009$TRAN`009'?',TPA$_EXIT,HELP`009`009;Print help X`009$TRAN`009'EXIT',TPA$_EXIT,RET_EOF`009;Quit X`009$TRAN`009'HELP',TPA$_EXIT,HELP`009`009; ... X`009$TRAN`009'SET',ST_SET`009`009`009;Set the ACCPORNAM X`009$TRAN`009'SHOW',ST_SHOW`009`009`009;Show the ACCPORNAM X X; Set X X`009$STATE`009ST_SET`009`009`009`009;Set the ACCPORNAM X X`009$TRAN`009TPA$_FILESPEC,,CHECK_DEVICE`009;Go check the device name out X X`009$STATE`009`009`009`009`009;Here to set the string X X`009$TRAN`009!ST_NAME,TPA$_EXIT,SET_ACCP`009;Go set the string X X; Show X X`009$STATE`009ST_SHOW`009`009`009`009 ;Show the ACCPORNAM X X`009$TRAN`009TPA$_FILESPEC,TPA$_EXIT,SHOW_ACCP ;Go show the access port name X X; Sub-expression to swallow stuff until EOS. X X`009$STATE`009ST_NAME`009`009`009`009;Sub-expression to collect until EOS X X`009$TRAN`009TPA$_LAMBDA,,BLANKS_VISIBLE`009;Make blanks visible again X X`009$STATE`009ST_NAME_1`009`009`009;Here to collect until EOS X X`009$TRAN`009TPA$_EOS,TPA$_EXIT`009`009;Quit at EOS X`009$TRAN`009TPA$_ANY,ST_NAME_1`009`009;Else munch another character X X`009$END_STATE`009`009`009`009;End of the state table X X`009.Page X`009.Subtitle`009Impure storage X X`009.Psect`009IMPURE_DATA`009NOEXE,RD,WRT,PIC,NOSHR,PAGE X X X; TPARSE parameter block. X XTPARSE_BLOCK:`009.Long`009TPA$K_COUNT0`009;Argument count X`009`009.Blkb`009TPA$K_LENGTH0-4`009;Allocate the rest of the block X X X; Random other crud. X XDEVICE_CLASS:`009.Blkl`009`009`009;Device class XDEVICE_STS:`009.Blkl`009`009`009;Device status XDEVICE_DESC:`009.Blkl`009`009`009;Device name X`009`009.Address DEVICE_BUFF`009; descriptor XACCP_DESC:`009.Blkl`009`009`009;Access Port Name X`009`009.Address ACCP_BUFF`009; descriptor XTT_DESC:`009.Blkl`009`009`009;Physical terminal X`009`009.Address TT_BUFF`009; descriptor X XIN_BUFF:`009.Blkb`009128`009`009;Command input buffer XTT_BUFF:`009.Blkb`00964`009`009;Physical terminal name buffer XDEVICE_BUFF:`009.Blkb`00964`009`009;Device name buffer XACCP_BUFF:`009.Blkb`00964`009`009;Access Port Name buffer X X`009.Page X`009.Subtitle`009Pure storage X X`009.Psect`009PURE_DATA`009NOEXE,RD,NOWRT,PIC,SHR,PAGE X X X; $GETDVI wish list. X XDVI_LIST:`009Item`009Item=DEVCLASS,-`009`009;Get the device class X`009`009`009RetAdr=DEVICE_CLASS`009;Put it here X`009`009Item`009Item=STS,-`009`009;Get the device status word X`009`009`009RetAdr=DEVICE_STS`009;Put it here X`009`009Item`009Item=TT_PHYDEVNAM,-`009;Get the device name X`009`009`009Length=64,-`009`009;It can be this big X`009`009`009RetAdr=TT_BUFF,-`009;Put it here X`009`009`009RetLen=TT_DESC`009`009;Return the length here X`009`009Item`009Item=TT_ACCPORNAM,-`009;Get the Access Port Name X`009`009`009Length=64,-`009`009;It can be this big X`009`009`009RetAdr=ACCP_BUFF,-`009;Put it here X`009`009`009RetLen=ACCP_DESC`009;Return the length here X`009`009Item`009Item=DEVNAM,-`009`009;Get the device name X`009`009`009Length=64,-`009`009;It can be this big X`009`009`009RetAdr=DEVICE_BUFF,-`009;Put it here X`009`009`009RetLen=DEVICE_DESC`009;Return the length here X`009`009.Long`0090`009`009`009;That's all X X X; Help text. X XHELP_TEXT:`009.Ascip`009<> X`009`009.Ascip`009 X`009`009.Ascip`009<> X`009`009.Ascip`009 X`009`009.Ascip`009 X`009`009.Ascip`009 X`009`009.Ascip`009<> X`009`009.Long`0090 X X X; Other random text. X XPROMPT:`009`009.Ascid`009"ACCP> " XUS:`009`009.Ascid`009"ACCP" X X`009.Page X`009.Subtitle`009Entry point X X`009.Psect`009CODE`009`009EXE,RD,NOWRT,PIC,SHR,PAGE X X`009.Entry`009START,`094M<>`009`009;Entry here X X`009MOVAB`009COND_HANDLER,(FP)`009;Establish a condition handler X`009MOVAL`009TPARSE_BLOCK,R11`009;Address our TPARSE block X X; Loop here reading commands from SYS$INPUT. X X10$:`009MOVZBL`009#128,TPA$L_STRINGCNT(R11) ;Reset the input X`009MOVAB`009IN_BUFF,TPA$L_STRINGPTR(R11) ; descriptor X`009MOVL`009#TPA$M_ABBREV,-`009`009 ;Reset the X`009`009TPA$L_OPTIONS(R11)`009 ; TPARSE options X`009PUSHAW`009TPA$L_STRINGCNT(R11)`009 ;Return the length here X`009PUSHAQ`009PROMPT`009`009`009 ;Prompt with this X`009PUSHAQ`009TPA$L_STRINGCNT(R11)`009 ;Here's the input buffer X`009CALLS`009#3,G`094LIB$GET_INPUT`009 ;Fetch some input X`009BLBC`009R0,20$`009`009`009 ;Presume EOF X`009TSTW`009TPA$L_STRINGCNT(R11)`009 ;Any input? X`009BEQL`00910$`009`009`009 ;If EQL no, ask again X X; Feed the command to TPARSE. Command execution handled by TPARSE X; action routines. X X`009PUSHAL`009ACCP_KEYS`009`009;Stack the keyword table address X`009PUSHAL`009ACCP_STATES`009`009;Stack the state table address X`009PUSHL`009R11`009`009`009;Stack the TPARSE block address X`009CALLS`009#3,G`094LIB$TPARSE`009`009;Parse the command X`009BLBS`009R0,10$`009`009`009;Win! X X; Here on some sort of error. X X20$:`009CMPL`009#RMS$_EOF,R0`009`009;End of file? X`009BEQL`00940$`009`009`009;If EQL yes, not an error X`009BBS`009#STS$V_INHIB_MSG,R0,10$`009;Branch if we've already signalled the V error X`009CMPL`009#LIB$_SYNTAXERR,R0`009;Syntax error? X`009BNEQ`00930$`009`009`009;If NEQ no, a real problem X`009PUSHAQ`009TPA$L_TOKENCNT(R11)`009;Else stack the token descriptor addres Vs X`009PUSHL`009#1`009`009`009;1 FAO argument X`009PUSHL`009#ACCP$_SYNTAX`009`009;Stack the error code X`009CALLS`009#3,G`094LIB$SIGNAL`009`009;Signal the error X`009BRB`00910$`009`009`009;And loop X X; Here on some drastic error. X X30$:`009PUSHL`009R0`009`009`009;Stack the error X`009CALLS`009#1,G`094LIB$STOP`009`009;Punt. X X; Here to exit peacefully. X X40$:`009MOVL`009#SS$_NORMAL,R0`009`009;Success X`009RET`009`009 X X`009.Page X`009.Subtitle`009HELP`009`009- List brief help X X;+ X; X; ----- HELP: List brief help X; X; X; This routine is called as a TPARSE action routine to print X; brief help on SYS$OUTPUT. X; X; Inputs: X; X;`009HELP_TEXT`009- Table of help text pointers. X; X; Outputs: X; X;`009As described above. X; X;- X XHELP:`009.Word`009`094m`009`009`009;List brief help X X`009MOVAL`009HELP_TEXT,R2`009`009;Address the help text X X10$:`009PUSHL`009(R2)+`009`009`009;Stack the next descriptor address X`009BEQL`00920$`009`009`009;If EQL we're done X`009CALLS`009#1,G`094LIB$PUT_OUTPUT`009;Display it X`009BRB`00910$`009`009`009;Around and around we go X X20$:`009RET`009`009`009`009;Done X X`009.Page X`009.Subtitle`009RET_EOF`009`009- Return RMS$_EOF X X;+ X; X; ----- RET_EOF: Return RMS$_EOF X; X; X; This routine is called as a TPARSE action routine for the EXIT command. X; X; Inputs: X; X;`009None X; X; Outputs: X; X;`009R0`009- RMS$_EOF X; X;- X XRET_EOF: .Word`009`094m<>`009`009`009;Return RMS$_EOF X X`009MOVL`009#RMS$_EOF,R0`009`009;Return X`009RET`009`009`009`009; RMS$_EOF X X`009.Page X`009.Subtitle`009CHECK_DEVICE`009- Ensure that the device is a terminal X X;+ X; X; ----- CHECK_DEVICE: Ensure that the device is a terminal X; X; X; This routine will ensure that the target device is a terminal X; and is not a "ephemeral" device. X; X; Inputs: X; X;`009TPA$L_TOKENCNT(AP)`009- A descriptor of the device name X; X; Outputs: X; X;`009R0`009- Success or failure X; X;- X XCHECK_DEVICE: .Word `094m<>`009`009`009;Ensure that the device is a terminal X X; Get the scoop on this device X X`009$GETDVIW_S DEVNAM=TPA$L_TOKENCNT(AP),-`009;Fetch the X`009`009ITMLST=DVI_LIST`009`009`009; poop on this device X`009BLBC`009R0,10$`009`009`009`009;Lose! X X; Reject if it's not a terminal, off line, or a template device. X X`009MOVAQ`009DEVICE_DESC,R1`009`009`009;Presume it's not a terminal X`009MOVL`009#ACCP$_NOTERM,R0`009`009;Presume not a terminal X`009CMPL`009#DC$_TERM,DEVICE_CLASS`009`009;Is it? X`009BNEQ`00920$`009`009`009`009;Nope. X`009MOVL`009#ACCP$_OFFLINE,R0`009`009;Presume device off line X`009BBC`009#UCB$V_ONLINE,DEVICE_STS,20$`009;Branch if so X`009MOVAL`009TT_DESC,R1`009`009`009;It's a terminal, so use this name for er Vrors X`009MOVL`009#ACCP$_TEMPLATE,R0`009`009;Presume template device X`009BBS`009#UCB$V_TEMPLATE,DEVICE_STS,20$`009;Branch if so X`009MOVL`009#SS$_NORMAL,R0`009`009`009;Else we're X`009RET`009`009`009`009`009; Ok X X; Here on a system service error. X +-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-