User Tools

Site Tools


anatomy_of_your_login-dot-com_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
anatomy_of_your_login-dot-com_script [2018/11/21 21:27] – final tweaks lrickeranatomy_of_your_login-dot-com_script [2018/11/21 21:54] (current) lricker
Line 118: Line 118:
 $INTERACTIVE: $INTERACTIVE:
 $ SET TERMINAL /INQUIRE /INSERT $ SET TERMINAL /INQUIRE /INSERT
 +$ !
 +$ CALL CreDir "SYS$SCRATCH"  ! separate sub-dir for temp-files   ! ***
 +$ CALL CreDir "LOGS"         ! a sub-dir for batch log-files     ! ***
 $ ! $ !
 $ ! VMS-style command aliases (symbols) --                       ! *** $ ! VMS-style command aliases (symbols) --                       ! ***
Line 150: Line 153:
 $ ! $ !
 $ EXIT    ! 'F$VERIFY(0)' $ EXIT    ! 'F$VERIFY(0)'
 +$ !
 +$CreDir: SUBROUTINE
 +$ ! P1 : Subdirectory to test and create
 +$ ! P2 : Job logical name to define
 +$ IF ( P2 .EQS. "" ) THEN P2 = P1
 +$ homedd = F$TRNLNM("SYS$LOGIN") - "]"
 +$ IF ( F$SEARCH("''P1'.DIR;1") .EQS. "" )
 +$ THEN CREATE /DIRECTORY [.'P1']
 +$ ENDIF
 +$ DEFINE /JOB /NOLOG 'P2' 'homedd'.'P1']
 +$ EXIT 1
 +$ ENDSUBROUTINE  ! CreDir
 $ ! $ !
 </code> </code>
  
-The comments "! ***mark the lines where are added to replace ''INTERACTIVE'' stanza Line 9 in the original template/skeleton, plus a line added to the ''BATCH'' stanza to make re-submits easier.+The comments ''! ***'' mark the lines where are added to replace ''INTERACTIVE'' stanza Line 9 in the original template/skeleton, plus a line added to the ''BATCH'' stanza to make re-submits easier
 + 
 +This also includes a DCL subroutine, labelled ''CreDir'' (for "create directory") at the end of this script, to test for a user's home directory subdirectory, conditionally creating it plus a suitable logical name if it doesn't already exist.  Here, two subdirectories are tested and created, one for ''SYS$SCRATCH'' (redirected from the user's home directory), and a ''LOGS'' subdirectory for batch log-files.
  
 Note that these enhancement lines were easy to add right into the appropriate ''INTERACTIVE'' or ''BATCH'' stanza, and didn't take any complicated ''IF/THEN/ELSE'' logic to make things work right.  It's always best to keep things simple... Note that these enhancement lines were easy to add right into the appropriate ''INTERACTIVE'' or ''BATCH'' stanza, and didn't take any complicated ''IF/THEN/ELSE'' logic to make things work right.  It's always best to keep things simple...
Line 251: Line 268:
 </code> </code>
  
-This includes a DCL subroutine, labelled ''CreDir'' (for "create directory"at the end of this script, to test for user's home directory subdirectories, and create them plus a suitable logical name if they don't already exist.+The ''CreDir'' subroutine is called for two more (suggested) subdirectories.
  
 ==== Sys-Admin's LOGIN script ==== ==== Sys-Admin's LOGIN script ====
anatomy_of_your_login-dot-com_script.txt · Last modified: 2018/11/21 21:54 by lricker

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki