Routine ID: Z305 | |
---|---|
Author(s): R. Matthews, A. Cass | Library: KERNLIB, IBM VM/CMS only |
Submitter: | Submitted: 08.06.1989 |
Language: IBM Assembler | Revised: |
OBSOLETE
Please note that this routine has been obsoleted in CNL 219. Users are
advised not to use it any longer and to replace it in older programs.
No maintenance for it will take place and it will eventually disappear.
Suggested replacement: None
VMPACK is a package of Fortran--callable subprograms providing an interface to the VM/CMS operating system.
Structure:
SUBROUTINE subprograms
User Entry Names:
VMBEEP, VMCMS, VMREXX, VMRTRM,
VMSATN, VMTATN
Files Referenced: Virtual console
Usage:
Subroutine VMBEEP:
CALL VMBEEPwill sound the alarm on the virtual console.
CALL VMCMS(COMAND,IRC)
Examples:
CALL VMCMS('FILEDEF 27 TERMINAL',IRC) MSG='EXEC TELL JIM THE FILEDEF HAS BEEN ISSUED' CALL VMCMS(MSG,IRC)
Restrictions:
It is not permitted to issue a CMS command which runs in the user area,
nor a command which invokes another program, as this will overwrite
the program which is executing.
The commonly used commands which run in the user area are:
ASSEMBLE, | COPYFILE, | EXECUPDT, | FORMAT, | LISTDS, | LKED, | LOADLIB, MACLIB, | MACLIST, |
MODMAP, | MOVEFILE, | OSRUN, | SORT, | TAPEMAC, | TAPPDS, | TXTLIB, | UPDATE. |
Subroutine VMREXX:
This subroutine can be called from a program which has been invoked
from a REXX exec to set, inspect or drop any of the exec's
variables.
CALL VMREXX(CODE,NAME,VALUE,IRC)
Examples:
CALL VMREXX('P','ARG',CHARS,IRC)will store the value of the primary argument list in the 80-character variable CHARS. If the argument list contains more than 80 characters, then only the first 80 will be transferred and the value of the return code will be .
Fetching and Setting Stem variables: Function codes 'A' and 'B' allow transfer of data between Fortran arrays and REXX stem variables. The REXX variable stem.0 must contain the number of elements to be transferred. Then 'A' moves data from REXX to Fortran, 'B' from Fortran to REXX:
/**/ line.0 = 5 line.1 = 'Hello' line.2 = 33 line.3 = 'alpha' line.4 = 'Beta' line.5 = 8567 'LOAD TEST(START' Do l = 1 To 5 Say mine.l End PROGRAM TEST CHARACTER*5 GET(MAX),SET(MAX) DATA SET/'DUMMY','LINES',' TO ','GIVE ','REXX '/ CALL VMREXX('A','LINE.',GET,IRC) WRITE (6,'(1X,A10)') GET CALL VMREXX('S','MINE.0','5',IRC) CALL VMREXX('B','MINE.',SET,IRC) ENDIf an error is detected accessing the stem.0 variable then the return code is set and processing stops -- no data is transferred. Otherwise all elements are processed regardless of truncation or existence errors and the return code is set to zero. Return code 16 indicates that the contents of stem.0 were not a valid integer. Return code 4 implies the same or that the integer was larger than 999,999,999.
Restrictions:
Note that the REXX variables within an Exec which calls a second Exec are not visible within the second Exec. This means that, for example, VMREXX has no knowledge of the variables within an Exec which invokes program execution by using the GO option of the VFORT exec.
The maximum number of elements that can be transferred with
codes 'A' and 'B' is 999,999,999.
Subroutine VMRTRM:
This subroutine will read a line from the console stack or, if the
stack is empty, directly from the console (i.e. the user must type
in a line):
CALL VMRTRM(LINE,LENGTH)
Subroutines VMSATN and VMTATN:
These subroutines can be used by interactive programs to process
attention interrupts from the virtual console. An attention interrupt
occurs when the user enters a string of characters on the command line
and presses the enter (or return) key at a time when the program has not
issued a read to the console, i.e. the user wishes to bring something to
the attention of the program even though the program has not requested
any input. This mechanism may be used, for example, to temporarily halt
a long-running program in order to query its status.
VMSATN is used to establish the attention interrupt mechanism and must be called before any attention interrupts can be detected:
CALL VMSATN(IRC)
CALL VMTATN(IRC)
Examples:
The following example shows a program which establishes the attention mechanism and then performs an iterative process.
VMTATN is called at the beginning of each iteration to determine whether an attention interrupt has occurred:
*... ESTABLISH THE ATTENTION MECHANISM CALL VMSATN(IRC) IF(IRC .NE. 0) THEN process the error ENDIF *... PERFORM ITERATIVE PROCESSING 1 CALL VMTATN(IRC) IF(IRC .NE. 0) THEN READ '(A)',LINE process the attention interrupt ELSE perform normal processing ENDIF GOTO 1 END
Restrictions:
CMS support for immediate commands (e.g. HX) requires that CMS
handles attention interrupts from the virtual console. Immediate
commands will therefore not be recognized by CMS when VMSATN and
VMTATN are used to handle attention interrupts. The PA1 key may,
however, be used to interrupt execution of the virtual machine and
put the virtual console into 'CP READ' status.