TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB IMS-DC Tools Articles Forum Quiz Interview Q&A

IMS Device(DEV) Statements


DEV- Device Characteristics:

After the FMT statement, code the DEV statement, which defines the characteristics of the device that we are communicating with. below figure shows the coding format for the DEV statement.

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
------ the parameters below are for 3270 displays -------
         DEV   TYPE={(3270,n) OR 3270-An),                             X
               FEAT=IGNORE,                                            X
               PFK=(dfldname,{‘literal’,. . .or                        X
               nn=’literal‘,. . .}),                                   X
                                    DSCA=X’nnnn’,                                           X
               SYSMSG=msgfield                                         X


------- the parameters below are for printers -------
         DEV   TYPE={(3270P,1) or (3270P , 2) or SCS 1),               X
               FEAT=IGNORE,                                            X
               WIDTH=nnn,                                              X
               PAGE=nn


TYPE

This parameter specifies the type and model of the device being used..


FEAT

This parameter specifies the feature to be used for the device. Use IGNORE to specify that device feature will be ignored, If IGNORE is not specified, FEAT= must specify exactly what was specified on the TERMINAL macro during the IMS/VS system definition. When TYPE=3270P (printer) and FEAT=IGNORE, MFS will allow a line width of 120 bytes.


PFK

The PFK parameter defines the input field and literal values for the PF keys. The first sub parameter dfldname is normally referenced by a message field (MFLD) statement (discussed in the MSG section) and cannot be used as the label of a DFLD statement within this DEV definition. The second and subsequent sub parameter(s) in positional or keyword format specify the value that will be generated when a PF key is pressed. When used positionally, MFS will assume a one-to-one correspondence between the ‘literal’ and the PF key. If a PF key is not assigned, a comma must be used to hold the position of the unassigned PF key.

In the nn=‘literal’ form, MFS associates the literal with the PF key specified by nn. There is no need for any place holding in this manner. The maximum number of PF keys is currently 36. If the literals are different lengths at the time the formats are being created, MFS will pad each literal on the right with blanks so that each will be as long as the longest literal.

The PFK parameter can also be set to the following to support Physical paging.

NEXTPP or NEXTMSGP or NEXTLP or ENDMPPI

NEXTPP fetches the next physical page of a message. NEXTMSGP skips the remaining pages of the physical message and skips to the next physical message. NEXTLP requests the next logical page of a message. ENDMPPI indicates the end of entry of data for a input message with multiple pages.

Remember, a period following an operator command will cause all data after the period to be treated as comments. Be sure to add a period after the operator command so that the other data contained as part of the message will be treated as a comment.


WIDTH

The WIDTH parameter is for printers and specifies the line width for input or output. The maximum width is 255. The default values are 132 for SCSI, and 120 for 3270p output.


PAGE

The PAGE parameter, also for printers, defines the number of print lines to a page The range is from 1 to 255, with the default value being 55.

DSCA parameter. When X’00A0’ causes unprotected field in the terminal to be erased before new data is written to the terminal. X’00C0’ causes the entire terminal buffer to be cleared before data is written to the terminal.

SYSMSG indicates the name of a DFLD that can be used to display messages from IMS. The field must be 79 characters long. Programs can write to this field too.

MFS uses the TYPE and FEAT parameters to create the control block name. First byte is set to X’00’ for 3270-1, X’02’ for 3270-2 and so on. The second byte is set to X’7F’ if the features of the device are ignored. Next 6 bytes are from the FMT macro label. 1st character of the label in the block name is lowercase for a DIF block and upper case for a DOF block, where the same statements generate both a DOF as well as a DIF.

Let's proceed with our coding example and include the DEV statement. Remember from the screen layout that PF2 will cause an application program with transaction code ABCPSTPT to be scheduled, and that PF3 will take the client to the maintenance menu with mod name ABCOMENU.

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
ABCSTA   FMT
          DEV   TYPE=3270-A2,FEAT=IGNORE,PFK=(PFKEYS00,                 X
                2='ABCPSTPT      ’,                                     X
                3='/FOR ABCOMENU.’)


DIV-Device Format:

The next device statement is DIV, which defines the device formats within the DIF and DOF. Although there are many parameters, we will discuss only one, as shown below,

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
           DIV   TYPE={INPUT or OUTPUT or INOUT} 

TYPE:

The TYPE parameter identifies whether this is DIF, DOF, of both. Typically, the same input and output formats are used. In that case, the value INOUT is used for TYPE. It is not necessary to code separate DIF and DOF source statements when using TYPE=INOUT.

With INOUT, the MFS utilities will generate the DIF and DOF control blocks and differentiate the two. It does this by tweaking the first character of the label on the FMT macro to upper case for a DOF and lower case for the DIF. Always code INOUT for an 3270 display station.

Adding the DIV statement to our code, we now have the following:

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
ABCSTA   FMT
         DEV   TYPE=3270-A2,FEAT=IGNORE,PFK=(PFKEYS00,                 X
               2=’ABCPSTPT       ’                                     X
               3=’/FOR  ABCOMENU.’)
         DIV   TYPE=INOUT


DPAGE – Device Logical Page:

The DPAGE statement is normally not coded, unless you are using logical paging, or you wish to take advantage of a device option such as initial cursor positioning. Another use of the DPAGE is to specify a fill character for output device fields. Figure 5 shows the format of the statement, as we will use in this course.

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
         DPAGE CURSOR=((LL,cc[,cfield])),                              X
               ,          X
                                     

CURSOR:

The CURSOR parameter allows you to specify where the cursor is initially placed on the display, using the coordinates line (11) and column (cc). The values for 11 and cc depend on the device type, such as a 24 x 80 or 32 x 80 display. If the DPAGE statement is left off of the format, the default is for the cursor to be initially placed at position (1,2) on the display.

Specify cfield that points to a pseudo field (a MFLD without a corresponding DFLD) that defines a field of 4 bytes. The first two bytes will have the LL value and the next two bytes a CC value which is the position of the cursor when the enter key was pressed.


FILL

The FILL parameter allows you to specify a fill character or fill action to be taken. The default for a 3270 display device is FILL=PT. The default for all other devices is FILL=X‘40’.

FILL=PT will cause a tab character to be placed at the end of the data placed into a DFLD if the data from the MOD did not fill the field. This tab character will cause the remaining data to be cleared from the field on output, when the data supplied by the program is less than the length of the field

FILL=X‘hh’ will cause the character representation of the hex value to be used as fill in each of the output device fields.

FILL=C‘c’ will cause the character specified to be used as fill in each of the output device fields.

FILL=NONE. This value is specified when the FILL= parameter is used on the MOD. If this is not used, the FILL= on the MOD will be ignored.

FILL=NULL means that the output device fields are not to be filled.

MULT=YES specifies that multiple physical pages can be used to generate an input message.

Let's add the DPAGE statement and see how our format looks.

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
ABCSTA   FMT
         DEV   TYPE=3270-A2,FEAT=IGNORE,PFK=(PFKEYS00,                 X
               2=’ABCPSTPT       ’                                     X
               3=’/FOR  ABCOMENU.’)
         DIV   TYPE=INOUT
         DPAGE CURSOR=((06,38)),FILL=PT


DFLD - Device Field:

Now that we have defined the device formats and characteristics, we need to define the input, output, literals, and fields that will appear on the device. This is done via the DFLD statement. Figure 6 shows some of the common parameters used.

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
....... the parameters below are for 3270 displays .......
label    DFLD  {'literal'},                                            X
               POS=(11,cc),                                            X
               LTH=nn,                                                 X
               ATTR=({ALPHA or NUM},{NOPROT or PROT}                   X
               (NOMOD or MOD },{NORM or NONDISP or HI}),               X
               


....... the parameters below are for printers .......
label    DELD  {'literal'}                                             X
               POS=(11,cc),                                            X
               LTH=nn,                                                 X
               ATTR=(NO or YES)

label:

This parameter is the label associated with the DFLD. It can be from one to eight characters in length, and typically has a naming convention. It can be descriptive of the position of the field on the screen (such as DLFD1135 – the field on line 11, column 35), or it can be descriptive of the purpose of the field (DATEIN – Status Date In field).

If no literal is specified, you must provide a label for the DFLD, which is normally referenced by an MFLD statement (discussed in the MSG section).


literal:

This parameter is optional. It is only required when you want a literal to appear on the display. The length of the literal depends on the device and does not need to be specified. For a 3270 display and 3270P printer, a maximum of 256 bytes is allowed. Labels cannot be used on DFLD’S that specify literals.


POS:

This parameter specifies the display coordinates for the field in a LL,CC format. The values for line (LL) and column (cc) depend on the device defined. POS=(01,01) is reserved and cannot be defined by a DLFD.


LTH:

The LTH parameter specifies the length of the field. The maximum value depends on the device, but must not exceed the physical page size of the device. If a literal is specified, there is no need to code the LTH parameter since the actual literal length will be used. The Maximum length is the maximum page size for the device type, minus one.

Note: POS and LTH do not account for the 1 byte on the 3270 display device used for holding the attribute information. It is necessary to account for this byte while in the design of the display screen. If the field starts in column 1 of a line, (with the exception of line 1), the attribute byte will occupy the last byte on the preceding line.


ATTR:

This keyword allows the programmer to define how the field will physically appear on the screen. The common attribute sub parameters are described below.


EATTR:

This attribute is used to define the color of the field, if the terminal supports color.


ALPHA / NUM:

This is used to specify if the Numeric Lock feature of a keyboard will be used. This means that normally only numeric data may be entered into this field. For a non literal field, the default is ALPHA. Be very careful not to rely on the NUM sub parameter for editing, as most new keyboards will allow the user to disable the Numeric Lock feature and/or type upper case alphabetic data into a numeric field.

Note: The default for a literal field is NUM.

NOPROT / PROT:

This sub parameter specifies whether the field is protected from input by the client (PROT), or the client may input data into the field (NOPROT).

Note: If PROT is used in combination with NUM, an auto-skip feature is enabled. That is, when the last byte of a NOPROT field is filled, the cursor will automatically skip to the first byte of the next NOPROT field on the screen. The default for a literal field is PROT. For a non-literal field, the default is NOPROT.


NOMOD / MOD:

These sub parameters cause the Modified Data Tag (MDT) to be set MOD or NOMOD. The MDT tells MFS whether the field has been modified by the client. IF MOD is specified, the MDT will be yes whether or not it was actually modified. The current data on the display will be included in the message, instead of only those fields that were modified.

Note: Normally, all DFLD’S that will be used in the MID should have the MOD attribute specified. This will cause the inclusion of all MID fields when creating the message, whether or not the client actually modified those fields. The default is always NOMOD.


NORM, NODISP:

This sub parameter specifies whether the field should be displayed in normal intensity (NORM), hidden from client view (NODISP), or highlighted – bright HI intensity (H) . The default is always NORM.


FMTEND:

The last device statement is the FMTEND. It denotes the end of a FMT, which means the end of a DIF or DOF, below figure shows the FMTEND statement structure.

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
         FMTEND

Let's complete our example format by adding the DFLD’S for the fields and literals we want displayed on the device.

------------------------------------------------------------------------
COLUMNS
****#****1*****1***2****$****3****$****4****$****5****$****6****$*****77
1        0     6   0         0         0         0         0          12
------------------------------------------------------------------------
         PRINT NOGEN                                                     1
ABCSTA   FMT
         DEV   TYPE=32700A2,FEAT=IGNORE,PFK=(PFKEYSOO,                 X
               2=‘ABCPSTPT’                                            X
               3=‘/FOR ABCOMENU.’)          DIV   TYPE=INOUT
         DPAGE CURSOR=((06,38)),FILL=PT
         DFLD  ‘ABCPSTAT’,POS=(01,2),ATTR=(NUM,PROT,HI)                  2
         DFLD  ‘ABC RENTAL COMPANY’,POS=(01,26),                       X
               ATTR=(ALPHA,PROT,HI)
         DFLD  ‘ABCOSTAT’,POS=(01,56),ATTR=(ALPHA,PROT,HI)               3
         DFLD  ‘DATE:’,POS=(02,2),ATTR=(ALPHA,PROT,HI) SYSDATE
         DFLD  POS=(02,8),LTH=8,ATTR=(ALPHA,PROT,NORM)                   4
         DFLD  ‘STATUS DISPLAY’,POS=(02,28),ATTR=(ALPHA,PROT,HI)
         DFLD  ‘TIME:’,POS=(02,56),ATTR=(ALPHA,PROT,HI)
SYSTIME  DFLD   POS=(02,62),LTH=08,ATTR=(ALPHA,PROT,NORM)                4
         DFLD  ‘ITEM NUMBER:’,POS=(06,25),ATTR=(ALPHA,PROT,HI)
ITEMNUM  DFLD  POS=(06,38),LTH=06,ATTR=(NUM,NOPROT,NORM,MOD)             5
         DFLD  ‘(PF2 - PRINT STATUS HISTORY)’,POS=(08,24),              X
               ATTR=(NNM,PROT,HI)
         DFLD  ‘(PF3 - RETURN TO MENU)’,POS=(09,24),                    X
               ATTR=(ALPHA,PORT,HI)
         DFLD  ‘========================================================X
               ===========’,POS=(10,2),ATTR=(ALPHA,PROT,HI)
         DFLD  ‘STATUS CODE:’,POS=(11,02),ATTR=(ALPHA,PROT,HI)
STCODE   DFLD  POS=(11,15),LTH=01,ATTR=(ALPHA,PORT,NORM)
         DFLD  ‘STATUS DATE IN:’,POS=(11,19),ATTR=(ALPHA,PROT,HI)
STDTIN   DFLD  POS=(11,35),LTH=06,ATTR=(ALPHA,PROT,NORM)
         DFLD  ‘STATUS DATE OUT’,POS=(11,44),ATTR=(ALPHA,PROT,HI)
STDTOUT  DFLD  POS=(11,61),LTH=06,ATTR=(ALPHA,PROT,NORM)
         DFLD  ‘STATUS DESCRIPTION: ’,POS=(13,02),                      X
               ATTR=(ALPHA,PROT,HI)
STDESC   DFLD  POS=(13,22),LTH=20,ATTR=(ALPHA,PROT,NORM)
        FMTEND 

This completes the physical portion of the screen. Before beginning the logical portion (MID/MOD), take a look at the numbered points of interest indicated in the above example:

  • The PRINT NOGEN is added so that the message and device macro statement expansion will not be printed in the output listing.

  • This is the literal for the transaction name.

  • This is the literal for the format MOD name.

  • This is where the date and time system variables will be displayed.

  • This is the only field the client can enter data. This is indicated by the NOPROT attribute.

It is recommended that you include the following information on every format you create:

Format MOD name



If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!

Are you looking for Job Change? Job Portal