Invocation of File Manager using LIBDEFs

FMNELIBD is a multi-purpose REXX exec to provide LIBDEF invocation of File Manager features and functions. This eliminates the need for various user-coded EXECs that perform LIBDEFs before invoking File Manager features or functions. The exec runs as follows.

Value
Description
FM
Invoke the File Manager primary options menu.
F1
Invoke the FM/IMS primary options menu.
F2
Invoke the FM/Db2 primary options menu.
FND
Invoke File Manager enhanced search.
LST
Invoke File Manager enhanced reference lists.
FUN
Invoke supported File Manager functions with data set names to populate the entry panels. See FUN parameter syntax.
DEF
Perform LIBDEFs for File Manager libraries from a REXX that invokes File Manager functions in keyword mode.
DROP
Clear LIBDEFs setup from FMNELIBD DEF command.
INV
To perform the equivalent function as FMNINV as specified in the ISPF Configuration tables.
  • FMNELIBD INV DSE / is the LIBDEF equivalent of FMNINV DSE /
  • FMNELIBD INV DSB / is the LIBDEF equivalent of FMNINV DSB /
  • FMNELIBD INV DSV / is the LIBDEF equivalent of FMNINV DSV /
See Making File Manager the default VSAM editor for more details.
MENU
To provide a LIBDEF invocation of a cut-down menu — equivalent to the FMNR exec.
See Invoking File Manager from ISPF 3.4 or a data set list for more details.
Note: For ease of use, create an intermediate exec with a short name as follows:
Example. Create member LFM in a data set in the SYSPROC or SYSEXEC concatenations.
	/* REXX – LIBDEF invocation of File Manager from ISPF 3.4 */
	ARG DSN
	CALL FMNELIBD ‘MENU ‘dsn
	EXIT 
LFM, in this case, is the command to invoke the File Manager cut-down menu from an ISPF 3.4 or a data set list.

FUN parameter syntax

If you specify FUN then the following syntax applies.
FMNELIBD FUN function 'dsn1(mbr1)' 'dsn2(mbr2)' 'dsn3(mbr3)' 'dsn4(mbr4)'

function must be one of the following supported functions.

Value
Description
CLM
Compare load module
DSB
Data set browse
DSC
Data set copy
DSE
Data set edit
DSG
Data set create
DSM
Data set compare
DSV
Data set view
PBK
Print and view copybook or template
SCS
Catalog services
TPIMP
Template import
TPEXP
Template export
TPED
Template edit
TPUP
Template update
VLM
View load module

'dsn1(mbr1)' is the input data set or path name.

'dsn2(mbr2)' is the input template (specify '-' to bypass).

'dsn3(mbr3)' is the output data set or path name.

'dsn4(mbr4)' is the output template.

Note: You can use the FMNELIBD REXX exec to invoke functions DSC, DSE, and DSV to copy, edit, and view data sets, CICS resources, and MQ queues using the appropriate format. For example, the format to invoke FMNELIBD for function DSE is the following:
Data set
call FMNELIBD FUN DSE 'data.set.name(memname)'
CICS resource
call FMNELIBD FUN DSE 'rt:applid:rname'
MQ queue
call FMNELIBD FUN DSE 'MQ:managerid:queuename'
See the sections Specifying a CICS resource and Specifying an MQ manager or queue for more information about specifying these resources.

Example 1. Invoking File Manager, FM/IMS, and FM/Db2 primary options from a selection panel

⋮)BODY CMD(ZCMD) ...
9       IBM                     Products IBM program development products
10      SCLM                    SW Configuration Library Manager
11      Workplace               ISPF Object/Action Workplace
FM      File Manager            File Manager for z/OS                 NEW
F1      FM/IMS                  File Manager/IMS for z/OS             NEW
F2      FM/DB2                  File Manager/DB2 for z/OS             NEW
⋮
)PROC  
⋮
&ZSEL = TRANS( TRUNC (&ZCMD,'.')  
⋮
9,'PANEL(ISRDIIS) ADDPOP'
10,'PGM(ISRSCLM) SCRNAME(SCLM) NOCHECK'
11,'PGM(ISRUDA) PARM(ISRWORK) SCRNAME(WORK)'
FM,'CMD(FMNELIBD FM)'   /* File Manager */                             Ⓝⓔⓦ
F1,'CMD(FMNELIBD F1)'   /* FM/IMS       */                             Ⓝⓔⓦ
F2,'CMD(FMNELIBD F2)'   /* FM/DB2       */                             Ⓝⓔⓦ

Example 2. ISPF command table with LIBDEF invocations

     Verb      T  Action  
____ FM        2  SELECT CMD(%FMNELIBD FM &ZPARM)       <= File Manager Base  
____ F1        2  SELECT CMD(%FMNELIBD F1 &ZPARM)       <= FM/IMS     
____ F2        2  SELECT CMD(%FMNELIBD F2 &ZPARM)       <= FM/DB2  
____ ELIST     2  SELECT CMD(%FMNELIBD LST &ZPARM)      <= Enhanced reference list  
____ EFIND     2  SELECT CMD(%FMNELIBD FND &ZPARM)      <= Enhanced search

Example 3. Using REXX to invoke the VLM function (view load module)

This example will run File Manager option 3.10.1 and populate the input data set field with 'FMN.LOAD'

/* REXX */ 
call FMNELIBD FUN VLM 'FMN.LOAD'

Example 4. Using REXX to invoke the DSE function (data set edit)

This example will run File Manager option 2 and populate the input data set field and template fields.

/* REXX */ 
call FMNELIBD FUN DSE 'FMN.FMDATA'  'FMN.TEMPLATE(SAMPLE)'

Example 5. Using REXX to invoke the DSE function (MQ queue edit)

This example will run File Manager option 2 and populate the input data set field with the MQ queue.

{{/* REXX */ 
call FMNELIBD FUN DSE 'MQ:MQ91:FMN.QUEUE.TEST'}}

Example 6. REXX load module report using the DEF and DROP parameters

/* REXX - VIEW LOAD MODULE - XML REPORT    */                  
/*                                         */                  
CALL FMNELIBD DEF                                              
ADDRESS TSO                                                    
  "ALLOC FI(SYSPRINT) DUMMY REUSE"                             
  'ALLOC FI(FMNXMLO) NEW SP(1,5) TRACKS,                       
        LRECL(1024) BLKSIZE(32720) RECFM( V B )'               
ADDRESS ISPEXEC                                                
  "SELECT CMD(FILEMGR $VLM DSNIN='FMN.LOAD'",                  
      "MEMBER=TURBO1,FUNCTION=PRINT,DATEFORM=YYMMDD,XML=YES)"  
ADDRESS TSO                                                    
  'EXECIO * DISKR FMNXMLO (STEM XMLO. FINIS'                   
  IF RC = 0 THEN DO                                            
    DO I = 1 TO XMLO.0                                         
      SAY XMLO.I                                               
    END                                                        
  END                                                          
  "FREE FI(FMNXMLO)"                                           
  "FREE FI(SYSPRINT)"                                          
CALL FMNELIBD DROP                                             
EXIT 0;