[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference koolit::vms_curriculum

Title:VMS Curriculum
Moderator:SUPER::MARSH
Created:Thu Nov 01 1990
Last Modified:Sun Aug 25 1996
Last Successful Update:Fri Jun 06 1997
Number of topics:185
Total number of notes:2026

26.0. "VMS FOR ADVANCED APP. USERS - Labs" by SUPER::ROUNDS (Kristin Rounds, DTN 381-1066) Wed Dec 19 1990 09:45

Labs for this course are located in the following file:

	SUPER::ES$REVIEW:[RA0294]RA0294_LABS.PS

No editing or additional development has been done on these labs.
Please tell us what you think of them (politely), how to make them 
better, etc.  If you have labs that work well for a particular
topic, please pass them on to us.
T.RTitleUserPersonal
Name
DateLines
26.1how about some comments?HARDY::BUNNELLThu Jan 10 1991 09:4512
    Hello out there................
    
    Is anyone out there?.............
    
    
    Hi folks,
    
    I find it  hard to believe that these labs are just PERFECT 8-)))).
    Please try to get your comments on these to us soon, we are running out
    of review time.
    
    Hannah
26.2UK here again - looking good!UKEDU::SHONEKeith Shone @RKA 830-4074Fri Jan 11 1991 04:4678
    Hi Hannah, we're here!
    
    My main nit on this set is the layout of command procedures. 
    That's my programming background and the desire for readability and
    maintainability of code.
    
    I see so many Digital-supplied command procedures that look absolutely
    awful - those used by VMS in startup and elsewhere. Sorry for those
    toes I'm reading on but I do feel we should set a good standard in ALL
    the code we supply to our customers. Having said that the ones in this
    set are easy on the eye and easily read!
    
    Take page 2 as an example:
    
    $ DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
    
    I would lay out thus:
    
    $ DEFINE -
    		/USER_MODE -
    		SYS$INPUT  -
    		SYS$COMMAND
    
    certainly I keep one qualifier to a line. This is along the same lines
    as a programming call to a procedure/function/subroutine - one argument
    per source line.
    
    Now, I'm not sure what performance implications there are for this
    style of layout. There's a lot spoken and mumbled about where commment
    characters should go and what blank lines and white space does for
    DCL's performance. Almost cetainly these examples would start to span
    two or more pages which causes irritation.
    
    Good to see commands and qualifiers spelled out in full.
    
    Page 3  - could we have at least one space between the "$" and the
    	      command? User-defined symbols - could they be uppercase and
              lowercase? E.g. ANS -> Ans to distinguish them from commands.
    
    Page 4  - space again between $ and command
    
    Page 12 - ditto
    
    Page 17 - Guess I'm just a wet blanket when it comes to these
    	      things but this exercise suggests that one might
              leave ones terminal unattended, logged in.
    
    	      Might this be dressed up as an alarm clock facility:
    
    	      $ SPAWN /NOWAIT /INPUT=NL: @Alarm_clock
    
    	      so the user is left at the terminal?
    	      Still get to use the WAIT command and also provides
    	      a reasonable use of SPAWN too.
    
    	      Alternatively use CONTROL-Y handlers etc to delete	     
              the process when someone tries to interfere - Yuk! Rather too
              advanced as well.
    
    Page 18 - I know SET TERMINAL /WIDTH=80 has the desired effect
              of clearing the display but it also sets the 132 wide
              screen I had before back to 80! OK its a nit!
    
    Page 31 - Yes, modularity IS wonderful!
    
    Generally:
    
    Layout, upper v. lowercase symbols are my main concerns. No, concerns
    is a bit strong. It's the way I would have written the code. I wonder
    how LSE would have us lay out command procedures?
    
    One thing that might be done - I was going to suggest occasionally but
    that might look inconsistent - was to use local symbols for strings
    like WRITE SYS$OUTPUT and Blank_line for WRITE SYS$OUTPUT ""
    
    Hope I haven't been too hard on this section ;-)
    
    -- Keith
26.3review labs VMS for adv. appl. user (or very very advanced)NWGEDU::JANSSENDushi KorsouFri Jan 18 1991 04:40175
Hi Hannah,
    
My comments:

Lab. Ex. Terminal I/O
=====================
1) Try to put a few spaces between the dollarsign and the DCL-commmand, maybe
   at least 7. 
   Start the command procedure with the label BEGIN and end with the label END.
   avoid the usage of single quotes in a string.
   Place blanklines to create blocks.
   e.g.

$! ----------------------------------------------------------
$! NAME         : WELKOM.COM
$! AUTHOR       : E. JANSSEN
$! DATE-WRITTEN : 09-APR-1990
$! REASON       : WELCOME on the system, for the user             
$! ----------------------------------------------------------
$! 	
$ BEGIN:
$       ON CONTROL_Y THEN GOTO END
$       WS          := WRITE SYS$OUTPUT
$       ESC[00,08]   = 27
$       SAVE_MESSAGE = F$ENVIRONMENT("MESSAGE")
$       SET MESSAGE/NOFACILITY/NOSEVERITY/NOIDENTIFICATION/NOTEXT
$!
$! Call in the system time  
$!
$       TIME     = F$CVTIME("",,"TIME")
$!
$       IF (TIME .LTS. "12:00:00.00")
$          THEN 
$             WS ESC,"[2J ''ESC'[1;1H"
$             WS ESC,"#3 Good morning ",F$GETJPI("","USERNAME")
$             WS ESC,"#4 Good morning ",F$GETJPI("","USERNAME")
$             WS " "
$             WS ESC,"#3 Welcome on ",F$GETSYI("NODENAME")
$             WS ESC,"#4 Welcome on ",F$GETSYI("NODENAME")
$          ELSE
$             WS ESC,"[2J ''ESC'[1;1H "
$             WS ESC,"#3 Good afternoon ",F$GETJPI("","USERNAME")
$             WS ESC,"#4 Good afternoon ",F$GETJPI("","USERNAME")
$             WS " "
$             WS ESC,"#3 Welcome on ",F$GETSYI("NODENAME")
$             WS ESC,"#4 Welcome on ",F$GETSYI("NODENAME")
$       ENDIF
$!
$! End procedure
$!
$ END:
$       SET MESSAGE 'SAVE_MESSAGE'
$       EXIT


Lab. Ex. Passing parameters to comm. proc's
===========================================
1) The solution on page 3 consists no spaces between the dollarsign and the 
   DCL-command. I miss the exit command.

Lab. Ex. Logical names
======================
1) Put $ DEASSIGN/ALL and $ DEASSIGN/PROCESS MYDIR on apart line e.g.

       $ DEASSIGN/ALL
    or
       $ DEASSIGN/PROCESS MYDIR

Lab. Ex. Global symbols
=======================
1) I recommand to put the exercise on page 11 into the login.com, so the
   student can user the symbols during the rest of the course.

2) Is the logical sys$login already clear for every student.

Lab. Ex. Debug a comm. proc.
============================
1) Place spaces after the dollarsign.

2) Change on page 12 the words "$DIRECTORY listing" into "directory listing".

3) Display the results of the run of the procedure

4) I miss the commands which has to be given for debugging the procedure

Lab. Ex. If-Then
================
1) I recommand to use the if-then-else statement as shown below:
        $         IF expression
        $            THEN command
        $            ELSE command
        $         ENDIF

2) Please spaces between $ and commands.

3) Place exercises into this chapter where the students can create command
   procedures by their self. The problems with if-then-else statement will come
   into existance automatically.
  
Lab. Ex. Terminal I/O Revisited
===============================
1) Don't give too much hints in the exercises. The student is permitted to
   develop his own solution, otherwise you create a monkey.
   Remove the hints on page 17:
     This exercise uses terminal input etc. etc.

   You is permitted to forbid to use lexicals.

2) Change the layout of the command procedure on page 18.

3) Change on page 18 BACKSOON=BACKSOON - 1 into BACKSOON = BACKSOON - 1

4) What is the reason of always using INQUIRE instead of READ/PROMPT
   READ/PROMPT gives an oppertunity to handle a CTRL-Z.

5) Explain on page 18 what the usage of TYPE/PAGE NL:

6) Place single quotes outside strings.

7) Replace TYPE SYS$INPUT by WRITE SYS$OUTPUT ""
                    
Lab. Ex. Command proc's
=======================
1) Change the layout of the command procedures with respect to spaces after the
   dollarsign, blanklines, begin and end labels, single quotes in strings,
   if-then-else

2) Where can I find the directory V5comproc$lex.

3) The hint (page 23) about reading the next two manuals is not necessary and is going to
   far:    Guide to Using VMS Command Procedures, Changing with F$VERIFY lexical
           function 
           F$VERIFY comm. description in the VMS DCL dictionary.
   The theory about procedure_verification and image_verification is too thin.
   Besides the explanation in the manauls is also not very clear. So expand the
   theory in the student book or skip it. By the way I think it going too far
   for an adv. appl user.
   Include the not modified command procedure into the text.

Lab. Ex. Errors and CTRL-Y
==========================
1) Where can I find the directory V5comproc$lex.

2) Change the layout of the command procedures with respect to spaces after the
   dollarsign, blanklines, begin and end labels, single quotes in strings,
   if-then-else

3) Put the = and == precisily underneath, this advances the readability of the
   procedure.   

4) Try to use meaningfull symbol name, e.g. PUR_ORDER instead of PO etc.

Lab. Ex. loopy logicals and subroutines
=======================================
1) Nor I could find TRANSLATE.COM. 

2) What do you mean with the words "instead of using recursion".

3) The layout of the file ITERATIVE_TRANS.COM looks much better. Maybe it's
   possible to place more spaces behind the dollarsign, put singel quotes
   outside a string.

4) This solution (ITERATIVE_TRANS.COM) is not easy to understand, so give more
   explanation at the solution.

5) Modify the layout of the file SUBROUTINE_CHOICE.COM.

6) It's not nice to jump out of a subroutine. See the subroutine TRANSLATE in
   the file ITERATIVE_TRANS.COM. 

7) Give also the solution for using the CALL-command.

Ed Janssen.

    
26.4Some comments for the last lab.COPCLU::SVENDSENThu Jan 24 1991 08:0874
Review of Ra0294 labs
    Here is what I fell over during a read through:
    
    The all refferencies to the ASSIGN command should be removed throughout
    all the labs.

    The solution for the Terminal I/O should be like this:

    $IF P1 .EQS. "" $THEN  $   INQUIRE P1 "pLS. GIVE A FILENAME" $ENDIF $!
    $WRITE SYS$OUTPUT "EDITING ''P1'" $! $DEFINE/USER_MODE SYS$INPUT
    SYS$OUTPUT $EDIT/TPU 'P1' $! $SET PROTECTION=(W:R) 'P1' $! $INQUIRE ANS
    "DO YOU WISH A PRINT OUT? $IF ANS .EQS. "" $THEN $   WRITE SYS$OUTPUT
    "THE FILE WILL BE PRINTET NOW" $   PRINT 'P1' $ENDIF $EXIT

    The solution for the "Passing parameters to command procedures" is
    wrong, it would be better like:

    $!  
    $! 
    $parcheck = p3+p4+p5+p6+p7+p8 
    $IF parcheck .NES. "" $THEN  
    $  WRITE SYS$OUTPUT "For mange parametre!!" 
    $EXIT $ENDIF 
    $IF p1 .EQS. "" 
    $THEN 
    $   INQUIRE p1 "mangler 1. tal - angiv tallet" 
    $ENDIF
    $IF p2 .EQS. "" 
    $THEN 
    $   INQUIRE p2 "mangler 2. tal - angiv tallet"
    $ENDIF  
    $! $sum = 'p1'+'p2' 
    $WRITE SYS$OUTPUT "''p1' + ''p2' = ''sum'"
    $exit
    
    I have ammended in my solution that the student should check that two
    and only two parameters are specified

    The format for the solution for the exercise concerning logical names
    should be :== (nomalized text assignment) as the form used may give
    confusion concerning symbols used as variables.

    The debug ex. looks OK.

    The IF-THEN exercise should use the form 

    $IF <bet> 
    $THEN 
    $  .. 
    $ELSE 
    $  .. 
    $ENDIF

    This form is more readable and is somewhat nearer structured
    programming. 

    Further the exercise should not depend on extensive knowledge about the
    semantics of the IF command. Statements of the type  "IF X" are such.

    The Terminal I/O revisited exercise miss the 10 blank lines in the
    solution.

    The lex function ex. should have an $ON ERROR THEN CONTINUE as first
    line in the solution.
    
    The "errors and CTRL/Y" solutions are OK.

    I do not see the great purpose of "loopy logicals"  (just the name!!).
    The subroutine solution is great however.

    Best 
    
    JOSS.

26.5@$#!!! last reply again.COPCLU::SVENDSENThu Jan 24 1991 08:1889
    Hi There.
    
    How I like initialisation macros!? Here is the last reply without my
    new scambler macro.
    
    Reviev of Ra0294 labs
    ---------------------
    
    The all refferencies to the ASSIGN command should be removed throughout
    all the labs.

    The solution for the Terminal I/O should be like this:

	$IF P1 .EQS. ""
	$THEN 
	$   INQUIRE P1 "pLS. GIVE A FILENAME"
	$ENDIF
	$!
	$WRITE SYS$OUTPUT "EDITING ''P1'"
	$!
	$DEFINE/USER_MODE SYS$INPUT SYS$OUTPUT
	$EDIT/TPU 'P1'
	$!
	$SET PROTECTION=(W:R) 'P1'
	$!
	$INQUIRE ANS "DO YOU WISH A PRINT OUT?
	$IF ANS .EQS. ""
	$THEN
	$   WRITE SYS$OUTPUT "THE FILE WILL BE PRINTET NOW"
	$   PRINT 'P1'
	$ENDIF
	$EXIT

    The solution for the "Passing parameters to command procedures" is
    wrong, it would be better like this:
  
    $!  
    $! 
    $parcheck = p3+p4+p5+p6+p7+p8 
    $IF parcheck .NES. "" $THEN  
    $  WRITE SYS$OUTPUT "For mange parametre!!" 
    $EXIT $ENDIF 
    $IF p1 .EQS. "" 
    $THEN 
    $   INQUIRE p1 "mangler 1. tal - angiv tallet" 
    $ENDIF
    $IF p2 .EQS. "" 
    $THEN 
    $   INQUIRE p2 "mangler 2. tal - angiv tallet"
    $ENDIF  
    $! $sum = 'p1'+'p2' 
    $WRITE SYS$OUTPUT "''p1' + ''p2' = ''sum'"
    $exit
                                       The format for the solution for the
    exercise concerning logical names should be :== (nomalized text
    assignment) as the form used may give confusion concerning symbols used
    as variables.

    The debug ex. looks OK.

    The IF-THEN exercise should use the form 
                                       
	$IF <bet>
	$THEN
	$  ..
	$ELSE
	$  ..
	$ENDIF
        This form is more readable and is somewhat nearer structured
    programming. 

    Further the exercise should not depend on extensive knowledge about the
    semantics of the IF command. Statements of the type  "IF X" are such.

    The Terminal I/O revisited exercise miss the 10 blank lines in the
    solution.

    The lex function ex. should have an $ON ERROR THEN CONTINUE as first
    line in the solution. The "errors and CTRL/Y" solutions are OK.

    I do not see the great purpose of "loopy logicals"  (just the name!!).
    The subroutine solution is great however.
       
    Best again 
    
    
    JOSS