HPlogo Using HP 3000 MPE/iX:\Advanced Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 8 Solutions

Solutions to Module 5: User Commands

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Check Your Answers

 Is Your Answer ... ?If Not, Start With
1.TRUELesson 1
2.FALSELesson 1
3.An abbreviation for User-defined command.Lesson 1
4.
  1. UDC executes.

  2. The system command executes.

Lesson 2
5.HELP UDCnameLesson 3
6.SETCATALOG Lesson 3
7.SETCATALOG UDCfile;APPENDLesson 3
8.OPTION NOPROGRAMLesson 4
9.OPTION RECURSIONLesson 4
10.
  1. The file MONEY prints out.

  2. The files DOLLARS and CENTS print out.

Lesson 5
11.It executes a LISTFILE of the specified file using the specified option (-1,0,1,2,3,4,6).Lesson 5
12.The command interpreter lets you toggle between EDIT/3000 and the operating system so that you can edit and test programs or command files.Lesson 6

Lesson 1 UDCs and Command Files

Exercise 5-1: Lesson 1 Review

1.

 CharacteristicsCommand FilesUDC Files
a.Must be cataloged. X
b.Uses commands and parametersXX
c.Command definitions must be separated by asterisks. X
d.Can easily be converted to the other.XX
e.Executes the OPTION LOGON. X
f.Can be created with a text processor.XX
g.Invoked by a command header. X
h.Invoked by a file name.X 

2.

  1. MYCOMM1

  2. MYCOMM2

  3. SHOWJOB

  4. SM, BEGIN

3.

 FunctionHELP UDC nameSHOW CATALOGPRINT UDC file name
a.List all UDC files currently cataloged for an account. X 
b.List the contents of a specified UDC.X  
c.List the contents of a specified UDC file.  X

************** End of Exercise 5-1 ************

Lesson 2 Understanding Search Priority and Search Path

Q 5-1

  1. user UDC SM

  2. account UDC LF

  3. user UDC TRYIT

Q 5-2

The UDC file executes.

Q 5-3

The UDC MYFILEX executes.

Exercise 5-2: Lesson 2 Review

Search path and execution priority problems include:

  1. system command LISTFILE

  2. program file DELFILE in your current group

  3. MPE/iX command PRINT

  4. command file MYLIST

************** End of Exercise 5-2 *************

Lesson 3 Cataloging UDCs

Q 5-4

  1. To delete all the UDC files from the UDC directory, you would enter the following command:

    SETCATALOG

  2. To add the UDC files MOSCOW, NAIROBI, and BRASILIA to the UDC directory without affecting other cataloged files, you would enter the following command:

    SETCATALOG MOSCOW,NAIROBI, BRASILIA;APPEND

  3. To replace existing UDC files in your UDC directory with the following files: NEWYORK, BOSTON, BOMBAY, and ZURICH, you would enter this command:

    SETCATALOG NEWYORK,BOSTON, BOMBAY,ZURICH

  4. To remove BOSTON and BOMBAY from the directory without affecting other UDC files, enter this command:

    SETCATALOG BOSTON,BOMBAY;DELETE

Lesson 4 Using UDC Options

Exercise 5-3: RECURSION Option

In order to allow UDC SO to call upon and execute UDC ST (without changing the order of the UDCs in the file), you would have to use OPTION RECURSION as follows:

   ST

   SHOWTIME

   ***

   SM

   SHOWME

   ***

   SO

   OPTION RECURSION

   SHOWOUT

   ST

   ***

********** End of Exercise 5-3 **********

Q 5-5

To make the UDC not executable from within a program, you need to add the NOPROGRAM option:

   LF

   OPTION NOPROGRAM

   LISTFILE

   ***
Q 5-6

  1. SHOWTIME is displayed. The LISTFILE command is not displayed because it is preceded by OPTION NOLIST.

  2. No MPE/iX commands are displayed because the OPTION NOLIST is still in effect.

  3. No MPE/iX commands are displayed because the OPTION NOLIST is still in effect.

Exercise 5-4: UDC Options

  1. The SLS UDC should look like this:

       SLS
    
       SHOWTIME
    
       LISTFILE
    
       OPTION LIST
    
       SHOWME
    
       ***
    
  2. The problem with the following UDC is that OPTION NOHELP can only appear directly after the header.

       LISTER
    
       OPTION NOLIST
    
       FILE OUT;DEV=LP
    
       PRINT MYFILE, OUT=*OUT
    
       OPTION LIST
    
       *OPTION NOHELP
    
       LISTFILE MYFILE,2
    
  3. Default values for the options are marked with an asterisk (*):

       LIST             NOLIST*
    
       HELP*            NOHELP
    
       RECURSION        NORECURSION*
    
       PROGRAM*         NOPROGRAM
    

************ End of Exercise 5-4 *****************

Lesson 5 Using Parameters

Exercise 5-5: Using Parameters

1.

The LS command file should look like this:

    

   PARM FILE NAME,OPTION="1"

   LISTFILE !FILE NAME,!OPTION
2a.

When you enter LS without any options, the following happens:

LISTFILE,1 executes by default.

2b.

When you enter LS with option 1, the following happens:

LISTFILE,1 executes.

When you enter LS with option 2, the following happens:

LISTFILE,2 executes.

When you enter LS with option 3, the following happens:

LISTFILE,3 executes.

3.

The LS UDC should look like this:

    

   LS FILE NAME,OPTION="1"

   LISTFILE !FILE NAME,!OPTION

   ***
4.

To uncatalog MYUDC3 and edit it, do the following:

Uncatalog MYUDC3:

SETCATALOG

Edit MYUDC3:

   LS FILE NAME,OPTION="1"

   LISTFILE !FILE NAME,!OPTION

   ***

Recatalog MYUDC3:

SETCATALOG MYUDC3

To execute LS, do the following:

   LS JOB1

   LS JOB1,2

   LS JOB1,3

************ End of Exercise 5-5 ****************

Feedback to webmaster