MVSDYNAM: Passing a DYNAM Command to the Command Processor

How to:

Available Operating Systems: z/OS

The MVSDYNAM function transfers a FOCUS DYNAM command to the DYNAM command processor. It is useful in passing allocation commands to the processor in a compiled MODIFY procedure after the CASE AT START command.


Top of page

x
Syntax: How to Pass a DYNAM Command to the Command Processor
MVSDYNAM(command, length, outfield)

where:

command

Alphanumeric

Is the DYNAM command enclosed in single quotation marks, or a field or variable that contains the command. The function converts lowercase input to uppercase.

length

Numeric

Is the maximum length of the command, in characters, between 1 and 256.

outfield

I4

Is the field that contains the result, or the format of the output value enclosed in single quotation marks.

MVSDYNAM returns one of the following codes:

0 indicates the DYNAM command transferred and executed successfully.

positive number is the error number corresponding to a FOCUS error.

negative number is the FOCUS error number corresponding to a DYNAM failure.

In Dialogue Manager, you must specify the format.



Example: Passing a DYNAM Command to the Command Processor

MVSDYNAM passes the DYNAM command contained in LINE to the processor. The return code is stored in RES.

-* THE RESULT OF ? TSO DDNAME CAR WILL BE BLANK AFTER ENTERING
-* 'FREE FILE CAR' AS YOUR COMMAND
DYNAM ALLOC FILE CAR DS USER1.CAR.FOCUS SHR REUSE
? TSO DDNAME CAR
-RUN
-PROMPT &XX.ENTER A SPACE TO CONTINUE.
MODIFY FILE CAR
COMPUTE LINE/A60=;
        RES/I4 = 0;
CRTFORM
" ENTER DYNAM COMMAND BELOW:"
" <LINE>"
COMPUTE
RES = MVSDYNAM(LINE, 60, RES);GOTO DISPLAY
 CASE DISPLAY
 CRTFORM LINE 1
" THE RESULT OF DYNAM WAS <D.RES"
GOTO EXIT
ENDCASE
DATA
END
? TSO DDNAME CAR

The first query command displays the allocation that results from the DYNAM ALLOC command:

DDNAME      =  CAR
DSNAME      =  USER1.CAR.FOCUS
DISP        =  SHR
DEVICE      =  DISK
VOLSER      =  USERMN
DSORG       =  PS
RECFM       =  F
SECONDARY   =   100  
ALLOCATION  =  BLOCKS
BLKSIZE     =      4096
LRECL       =      4096
TRKTOT      =         8
EXTENTSUSED =         1
BLKSPERTRK  =        12
TRKSPERCYL  =        15
CYLSPERDISK =      2227
BLKSWRITTEN =        96
FOCUSPAGES  =         8
ENTER A SPACE TO CONTINUE  >

Type one space and press Enter to continue. Then enter the DYNAM FREE command (the DYNAM keyword is assumed):

ENTER DYNAM COMMAND BELOW:
 free file car

The function successfully passes the DYNAM FREE command to the processor and the return code displays:

THE RESULT OF DYNAM WAS     0

Press Enter to continue. The second query command indicates that the allocation was freed:

DDNAME      =  CAR
DSNAME      =
DISP        =
DEVICE      =
VOLSER      =
DSORG       =
RECFM       =
SECONDARY   =  ****
ALLOCATION  =
BLKSIZE     =         0
LRECL       =         0
TRKTOT      =         0
EXTENTSUSED =         0
BLKSPERTRK  =         0
TRKSPERCYL  =         0
CYLSPERDISK =         0
BLKSWRITTEN =         0
>

Information Builders