Roger Bowler’s Trucs et Astuces for z/OS systems programmers

This is a collection of miscellaneous hints and tips (or “Trucs et Astuces” as they call them in France) which I have found useful in my work as an MVS - OS/390 - z/OS systems programmer. Maybe you might find something useful here too.

Index

Windows tips have been moved to wintips.htm

JES2 Tips

How can I find out what jobs are filling the JES2 spool?
Here is a selection of useful JES2 commands:

MVS Tips

How do I get step condition codes to print in the JES2 job log?
Install the SMF exit IEFACTRT. The source is in SYS1.SAMPLIB(IEEACTRT).
  1. Run this job to install the exit in a linklist library:
    //SPSMFXIT JOB CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=&SYSUID
    //ASMXIT  EXEC HLASMCL,REGION=4M,COND.L=(0,NE,C),              
    //             PARM.L='LIST,LET,NCAL,XREF,RENT,REUS'           
    //C.SYSLIB DD  DSN=SYS1.MACLIB,DISP=SHR                        
    //         DD  DSN=SYS1.MODGEN,DISP=SHR                        
    //C.SYSIN  DD  DSN=SYS1.SAMPLIB(IEEACTRT),DISP=SHR             
    //L.SYSLMOD DD DSN=USER.LINKLIB(IEFACTRT),DISP=SHR,UNIT=,SPACE=
    
  2. Update your SMF parameter member SMFPRM00 in USER.PARMLIB. You need SMF recording ACTIVE, you need to record at least type 30 records which drive the IEFACTRT exit, and of course you need to specify that exit IEFACTRT is active. Here is an example SMFPRM00 member:
     ACTIVE                          /* ACTIVE SMF RECORDING             */ 
     DSNAME(SYS1.MAN1,                                                      
           SYS1.MAN2,                                                       
           SYS1.MAN3)                                                       
     NOPROMPT                        /* DO NOT PROMPT OPERATOR           */ 
     REC(PERM)                       /* TYPE 17 PERM RECORDS ONLY        */ 
     MAXDORM(3000)                   /* WRITE IDLE BUFFER AFTER 30 MIN   */ 
     STATUS(010000)                  /* WRITE SMF STATS AFTER 1 HOUR     */ 
     JWT(2400)                       /* 522 AFTER 24 HOURS               */ 
     SID(&SYSNAME(1:4))              /* USE SYSTEM NAME FROM IEASYM00    */ 
     LISTDSN                         /* LIST DATA SET STATUS AT IPL      */ 
     SYS(TYPE(14:19,30,62:69),NOEXITS,NOINTERVAL,NODETAIL)                  
     /* WRITE ONLY DATA MANAGEMENT RECORDS, TAKE NO EXITS.               */ 
     /* NOTE: JES EXITS CONTROLED BY JES , THERE IS NO                   */ 
     /* DEFAULT INTERVAL RECORDS WRITTEN AND ONLY SUMMARY T32            */ 
     /* RECORDS AS A DEFAULT FOR TSO.                                    */ 
     SUBSYS(JES2,EXITS(IEFACTRT))                                           
     /* WRITE RECORDS ACCORDING TO SYS VALUE, TAKE ONLY IEFACTRT EXIT.   */ 
     /* USE ALL OTHER SYS PARMETERS AS A DEFAULT.                        */ 
    
  3. Enter this MVS command to activate the updated SMF parameters:
    T SMF=00
    
  4. Enter these MVS commands to activate the exit:
    F LLA,REFRESH
    SETPROG EXIT,DELETE,EXITNAME=SYSJES2.IEFACTRT,MODNAME=IEFACTRT
    SETPROG EXIT,ADD,EX=SYSJES2.IEFACTRT,MOD=IEFACTRT,DSN=USER.LINKLIB
    

What to check if it does not work:

  1. Check that MVS has picked up the SMF parameters from the correct library (and not from SYS1.PARMLIB for example). You should see this message when you activate the SMF parameters:
    IEE252I MEMBER SMFPRM00 FOUND IN USER.PARMLIB
    
  2. If it stops working after the next IPL, this is probably because there is an IEFACTRT in SYS1.LPALIB which takes precedence. Either delete or rename the module in IEFACTRT, or reissue the SETPROG EXIT DELETE and ADD commands. Note, if you use an automation tool such as VTAMAPPL to issue these commands, you may need to insert a delay of 1 or 2 seconds between the DELETE and the ADD commands.
Remind me of the commands to add datasets to the APF and LNKLST
SETPROG APF,ADD,DSN=USER.LOADLIB,VOL=OS39M1
SETPROG LNKLST,DEFINE,NAME=LNKLST01,COPYFROM=LNKLST00       
SETPROG LNKLST,ADD,NAME=LNKLST01,DSN=USER.LOADLIB,VOL=OS39M1
SETPROG LNKLST,ACTIVATE,NAME=LNKLST01
D PROG,APF
D PROG,LNKLST
How can I get XCFAS to deallocate and reallocate its datasets?
SETPROG LNKLST,UNALLOCATE       
SETPROG LNKLST,ALLOCATE       
How can I increase the size of a VTOC?
ICKDSF can now change the size of the VTOC without re-initialising the volume. Two methods are available:
  1. Extend the VTOC in place (if there is free space next to the VTOC):
     REFORMAT UNIT(xxxx) VERIFY(serial) EXTVTOC(new size)
    
  2. Move the VTOC to a different location on the volume:
     REFORMAT UNIT(xxxx) VERIFY(serial) NEWVTOC(cc,hh,n)
    

Thanks to Andrew B. Longtin for this tip

VTAM Tips

How can I logon to TSO with a larger screen size?
  1. If using Tom Brennan's Vista tn3270 (see http://www.tombrennansoftware.com) select Options->Display->User->62->132->OK
  2. logon applid=tso logmode=d4c32xx3
  3. ispf 0 and set screen format 3 (Max)

The maximum screen size supported by ISPF is 62 lines.
There's more information on Dave's TN3270 FAQ page at http://www.planetmvs.com/tn3270/faq.html

TCP/IP Tips

What is needed to allow a z/OS application to bind to a port less than 1024?
In TCPIP.TCPIP.PROFILE, the following statements restrict the ability of jobs to bind to the so-called "non-ephemeral" ports (port numbers 1-1023):
TCPCONFIG RESTRICTLOWPORTS
UDPCONFIG RESTRICTLOWPORTS
If these statements are specified, then the job must either be:
  1. APF-authorized, or
  2. Running under a userid defined in RACF with OMVS(UID(0)), or
  3. Mentioned in a PORT or PORTRANGE statement

A PORT or PORTRANGE statement with the optional keyword SAF followed by a 1-8 character name can be used to control access to the port using the RACF. Example: PORT 80 TCP * SAF HTTPSERV (where "*" means "any jobname"). You need to define a RACF resource in the class SERVAUTH with the following name:
EZB.PORTACCESS.sysname.tcpname.safname
where:

How can I get z/OS NSLOOKUP command to work and use the remote DNS?
(cribbed from IBM Developer Relations AD/CD Support)
  1. Copy TCPIP.SEZAINST(RESOPROC) to ADCD.ZOSV1R4.PROCLIB(RESOLVER)
    Note: since the resolver is started under the master subsystem, the procedure must be placed in one of the proclibs mentioned in the parmlib member MSTJCLxx
  2. Edit ADCD.ZOSV1R4.PROCLIB(RESOLVER) uncomment and change SETUP DD to DSN=ADCD.ZOSV1R4.PARMLIB(RESOLVER)
  3. Copy TCPIP.SEZAINST(RESSETUP) to ADCD.ZOSV1R4.PARMLIB(RESOLVER)
  4. Edit ADCD.ZOSV1R4.PARMLIB(RESOLVER):
    DEFAULTTCPIPDATA location_of_your_SYSTCPD_DSN
    GLOBALTCPIPDATA location_of_your_SYSTCPD_DSN
  5. Edit ADCD.ZOSV1R4.PARMLIB(BPXPRMxx):
    add statement RESOLVER_PROC(RESOLVER) after CTRACE entry
  6. TCPIP PROC SYSTCPD DD DSN should include:
    nsinteraddr your_local_dns_ip_address
    lookup dns local
  7. D OMVS,O
    before changes: RESOLVER PROC DEFAULT
    after changes: RESOLVER PROC RESOLVER
How can I run the z/OS FTP client in passive mode?
Use this command in the FTP client:
locsite fwf
What are the steps needed to set up IP PrintWay?

Here are the steps needed to make the IP PrintWay component of the OS/390 Print Server operational. The Print Server exists in OS/390 versions V2R5 through V2R7. IP PrintWay was previously packaged with the NetSpool element of OS/390 V1R3 and V2R4, and prior to that it was a feature of PSF/MVS. The procedure is considerably more complex from OS/390 V2R8 onwards, when IP PrintWay became part of the Infoprint Server product. The printer definitions are no longer contained in the ROUTING and OPTIONS datasets, instead IP PrintWay uses the definitions managed by the Printer Inventory Manager (AOP), an OMVS application which has to be configured and started under the Unix System Services component of z/OS. Which does complicate things somewhat. For OS/390 V2R8 through V2R10 and z/OS, you may find it easier to use the more basic Network Print Facility (NPF) instead. NPF is a separately orderable feature of the Communications Server component of OS/390 and z/OS.

  1. Copy procedure ANFWPROC from ANF.SANFPROC to SYS1.PROCLIB and customize as needed.
  2. APF-authorize the steplib (ANF.SANFLOAD) if necessary.
  3. Add an entry for program ANFFIEP to SCHEDxx if necessary:
         PPT PGMNAME(ANFFIEP) KEY(1) SYST NOSWAP NOPREF NODSI                   
         
    Use the T SCH=xx command to activate the new SCHEDxx member.
  4. Add FSS and PRT statements to JES2PARM:
         FSS(PRINTWAY) PROC=ANFWPROC,HASPFSSM=HASPFSSM,AUTOSTOP=YES                                                  
         PRT(1) FSS=PRINTWAY,MODE=FSS,CLASS=P,PRESELCT=YES,  
                START=YES,SEP=NO,TRKCELL=YES,WS=(Q)         
         
    Use the following commands to add the definitions dynamically:
    $addfss(printway),proc=anfwproc,auto=y
    $addprt(1),fss=printway,mode=fss,q=p,s=n,ws=(q)
  5. Customize and run the job ANFDEAL from ANF.SANFSAMP. This job will allocate the VSAM clusters ANF.ROUTING, ANF.OPTIONS, and ANF.QUEUE.
  6. Customize and run the job ANFQINIT. This job will initialize the ROUTING, OPTIONS, and QUEUE datasets.
  7. Customize and run the job ANFMIJCL to allocate and format the message dataset ANF.MSGFILE as a non-VSAM file (note: a D37 abend is expected and normal on this step).
  8. Modify TSO logon procedure ISPFPROC: add ANF.SANFPLIB to ISPPLIB, add ANF.SANFMLIB to ISPMLIB, add ANF.SANFEXEC to SYSEXEC
  9. Add new menu item "PANEL ANFIPM" to SYS1.LOCAL.ISPFPNLS(IBMPRODS)
  10. Set up RACF definitions for IP PrintWay:
          SETROPTS GENERIC(STARTED)
          AU ANFWPROC DFLTGRP(ANF) NAME('IP PRINTWAY') NOPASSWORD -
             OMVS(HOME(/) PROGRAM(/bin/logout) UID(636))
          ALG ANF OMVS(GID(636))
          PE 'ANF.*' ID(ANF) ACC(UPDATE)
          RDEFINE STARTED ANFWPROC.* STDATA(USER(ANFWPROC))
          SETROPTS REFRESH RACLIST(STARTED)
         
  11. Create dataset TCPIP.LPR.TCPXLBIN
What IP PrintWay options are needed for a PCL5 printer?
Here's an example setup for printing JES2 output 132 cols x 62 lines at 8lpi 12cpi on A4 Landscape paper (with barline stripes as an added bonus!)
 EDIT   ---------------------- IP PrintWay Routing Entry ---------------------- 
 COMMAND ===>                                                                   
                                                               USERID - ROLBOLA 
 DEST ===> LOCAL      CLASS ===> P   FORMS ===> STD            DATE   - 04/10/08
                                                               TIME   - 14:05   
 Retry       : Time     ===> 0000:01:00 (HHHH:MM:SS)                            
             : Limit    ===> 3          (0-32767)                               
 Retain Time : Success  ===> 0000:00:00 (HHHH:MM:SS)                            
             : Failure  ===> FOREVER    (HHHH:MM:SS)                            
                                                                                
 Port Number            ===>            (100-65535)                             
                                                                                
 Print Queue Name       ===> lp                                                 
                                                                                
 Host Name/IP Address   ===> 192.168.0.5                                        
                                                                                
 Options Name           ===> BARLINE                                            
                                                                                
 NetSpool Printer Name  ===>                                                    
 NetSpool LU Class      ===>                                                    
                                                                                
 NetSpool Default Page Format Entry ===>                                        
 NetSpool End-of-File Rules Entry   ===>                                        

Notes:

  1. CLASS should match the class in the JES2 printer definition.
  2. Be sure to specify "Retain Time Failure FOREVER", otherwise jobs will be deleted from the spool even if the print was unsuccessful!
  3. Specify either a port number (e.g. 9100) for a DIRECT (Raw) connection with the printer, or a queue name (normally "lp") for an LPD connection. You cannot specify a port number for an LPD connection (it is always port 515).
  4. "Host Name/IP Address" is the address of the printer.
  5. "Options Name" refers to the options entry shown below.
  6. You may also need to add a second routing entry with DEST=DFLTNTRY with all fields from Port Number onwards set to blank.

 EDIT   ---------------------- IP PrintWay Options Entry ----------------------
 COMMAND ===>
                                                               USERID - ROLBOLA
 Options Name ===> BARLINE                                     DATE   - 03/01/20
                                                               TIME   - 10:45

    LPR Options ===> delff leading noh linecount 60 lineterm 0d25 max 250000

    Exits
      Record         ===>
      Begin Data Set ===>
      End Data Set   ===>

    NetSpool Print Parameters ===>

    Advanced
     Transmission Group ===> 1  1. Job
                                     Concatenate
                                2. Data set

    Printer Setup Parameters ===>
      <ESC>E<ESC>(s0p0T<ESC>&k4S<ESC>&l26a1o1l6c2e62F<ESC>&a3L<ESC>&f2y0X<ESC>*
      r0F<ESC>*v0O<ESC>&a180H<ESC>*c7920h270v10g2P<ESC>&a+540V<ESC>&f1x10X<ESC>
      &f1y0x0S<ESC>&f2y3x3x3x3x3x3x3x3x3x3X<ESC>&f1s1x10x4X

Explanation of setup string:

<ESC>E         Reset
<ESC>(s0p      Fixed width character spacing
       0T            Lineprinter font
<ESC>&k4S      Elite (12cpi)
<ESC>&l26a     A4 paper size
       1o            Landscape
       1l            Enable perforation skip
       6c            8lpi
       2e            Top margin 2 lines
       62F           Page length 62 lines
<ESC>&a3L      Left margin 3 columns

The following macro draws one horizontal stripe 3 lines deep

<ESC>&f2y     Macro ID 2
       0X           Start macro definition
<ESC>*r0F     Rotate image
<ESC>*v0O     Pattern transparent
<ESC>&a180H   Indent 0.25"
<ESC>*c7920h  Rectangle width 11"
       270v         Rectangle height 0.375"
       10g          Fill 10% grey
       2P           Shaded fill
<ESC>&a+540V  Move cursor down 0.75"
<ESC>&f1x     Stop macro definition
       10X          Make macro permanent

The following macro defines an overlay of 10 horizontal stripes

<ESC>&f1y     Macro ID 1
       0x           Start macro definition
       0S           Save cursor
<ESC>&f2y     Macro ID 2
       3x3x3x3x3x3x3x3x3x3X   Call macro 10 times
<ESC>&f1s     Restore cursor
       1x           Stop macro definition
       10x          Make macro permanent
       4X           Enable overlay
What are the steps needed to set up NPF?
  1. Create a sequential dataset TCPIP.NPF.DATA (using the attributes of TCPIP.TCPIP.DATA as a model) and copy TCPIP.SEZAINST(NPFDATA) to it.
  2. Customize and run the job DELALLOC from TCPIP.SEZAINST. This job will allocate the VSAM clusters TCPIP.NPF.ROUTING, TCPIP.NPF.OPTIONS, and TCPIP.NPF.QUEUE.
  3. Customize and run the job ROUTEOPT from TCPIP.SEZAINST. This job will initialize the ROUTING, OPTIONS, and QUEUE datasets. The only statements you need in the assembly step are
                   EZAPPFL TYPE=INITIAL
                   EZAPPFL TYPE=FINAL
                   END
         
    as all the other entries can be added later via ISPF panels.
  4. Allocate 2 new sequential datasets (VBA/133/137): TCPIP.NPF.NPFWTR.LOG and TCPIP.NPF.NPFQMGR.LOG
  5. Copy procedure FSWTR from TCPIP.SEZAINST to USER.PROCLIB member NPFWTR and customize dataset names as needed. Add PARM='ESTAE-SDUMP=NO' to the EXEC card. You may also want to change the log dataset to DISP=SHR (to allow you to browse it via TSO while NPF is running) and remove the SYSABEND and SYSMDUMP DD cards.
  6. Copy procedure QUEMGR from TCPIP.SEZAINST to USER.PROCLIB member NPFQMGR and customize dataset names as needed.
  7. Ensure that the library containing programs EZAPPFS and EZAPPQSA is APF-authorized and in the linklist. The programs are normally installed in TCPIP.SEZALOAD so no action should be necessary.
  8. Ensure that SCHEDxx contains the following entries:
         PPT PGMNAME(EZAPPFS) KEY(1) NOSWAP           
         PPT PGMNAME(EZAPPAAA) NOSWAP           
         
    Use the T SCH=xx command to activate the new SCHEDxx member if you needed to change it.
  9. Set up RACF definitions for NPF:
          SETROPTS GENERIC(STARTED)
          AU NPFSTC DFLTGRP(OMVSGRP) NAME('NETWORK PRINT STC') NOPASSWORD -
             OMVS(HOME(/) PROGRAM(/bin/logout) UID(637))
          AD 'TCPIP.NPF.*' OWNER(SYS1) UACC(READ) GENERIC
          PE 'TCPIP.NPF.*' RESET
          PE 'TCPIP.NPF.*' ID(SYS1) ACCESS(ALTER)
          PE 'TCPIP.NPF.*' ID(NPFSTC) ACCESS(ALTER)
          RDEFINE STARTED NPFWTR.* STDATA(USER(NPFSTC))
          RDEFINE STARTED NPFQMGR.* STDATA(USER(NPFSTC))
          SETROPTS REFRESH RACLIST(STARTED)
         
  10. Allow NPFQMGR to access restricted ports 721-731:
          SETROPTS GENERIC(SERVAUTH) CLASSACT(SERVAUTH) RACLIST(SERVAUTH)
          RDEFINE SERVAUTH EZB.PORTACCESS.*.TCPIP.LPR UACC(NONE)
          PE EZB.PORTACCESS.*.TCPIP.LPR CL(SERVAUTH) RESET
          PE EZB.PORTACCESS.*.TCPIP.LPR CL(SERVAUTH) -
             ID(NPFSTC) ACCESS(READ)
          SETROPTS REFRESH RACLIST(SERVAUTH)
         
    and add the following statement to USER.TCPPARMS(PROFILE):
         PORTRANGE 721 12 TCP * SAF LPR  ; LPD requester
         
    You can dynamically activate the PORTRANGE statement by placing it in a member by itself and entering the MVS console command:
         v tcpip,,o,user.tcpparms(lprports)
         
  11. Add FSS and PRT statements to JES2PARM:
         FSS(NPF) PROC=NPFWTR,HASPFSSM=HASPFSSM,AUTOSTOP=YES                                                  
         PRT(1) FSS=NPF,MODE=FSS,CLASS=P,PRESELCT=YES,  
                START=YES,SEP=NO,TRKCELL=YES,WS=(Q)         
         
    Use the following commands to add the definitions dynamically:
    $addfss(npf),proc=npfwtr,auto=y
    $addprt(1),fss=npf,mode=fss,q=p,s=n,ws=(q)
  12. Assemble and link the Input Record Exit NPFXBARL into USER.LINKLIB and issue the command F LLA,REFRESH
  13. Ensure that the TSO logon procedure ISPFPROC contains TCPIP.SEZAMENU in the ISPMLIB concatenation, and TCPIP.SEZAPENU in the ISPPLIB concatenation.
  14. Add new menu item "PANEL(EZAPPMP)" to USER.ISPPLIB(IBMPRODS)
  15. Using the NPF panels (ISPF option M), add an OPTIONS entry with the following parameters:
     EDIT   -------------------------- NPF Options Record -------------------------
     COMMAND ===>                                                                  
                                                                                   
        OPTIONS NAME              ====> BARLINE                                    
        INPUT RECORD EXIT         ====> NPFXBARL                                   
        LPR OPTIONS               ====> NOH LINECOUNT 60                           
                                                                                   
    
    Unlike IP PrintWay, you cannot specify PCL setup strings in the OPTIONS record. Instead, an Input Record Exit NPFXBARL is specified. This exit contains hardcoded PCL setup strings equivalent to those used in the IP PrintWay example above.
  16. Then add a ROUTING entry with the following parameters:
     EDIT   -------------------------- NPF Routing Record -------------------------
     COMMAND ===>                                                                  
                                                                                   
     MAJOR NAME        ===> LOCAL              MINOR NAME     ===> PSTD            
     LUCLASS           ===>                                                        
                                                                                   
     NO OF DEST        ===> 1                                                      
     RETAIN TIME(S)    ===> 0000000            RETAIN TIME(U) ===> 3662359         
     RETRY INTERVAL    ===> 0000030            RETRY LIMIT    ===> 32767           
     DEF PAGE FORMAT   ===>                    EOFILE NAME    ===>                 
     OPTIONS NAME      ===> BARLINE            ROUTING EXIT   ===>                 
     HOST NAME/IP ADDR ===> 192.168.0.5                                            
                                                                                   
     PRINTER NAME      ===> lp                                                     
                                                                                   
    

    Notes:

    1. The first character of the MINOR NAME should match the class (P) which we specified earlier in the JES2 printer definition. The remaining characters (STD) should match your standard JES2 forms name.
    2. Be sure to specify "Retain Time (U)", otherwise jobs will be deleted from the spool even if the print was unsuccessful!
    3. "Host Name/IP Address" is the address of the printer.
    4. "Printer Name" is an LPD queue name recognized by the printer (normally "lp"). You cannot specify the destination port number (it is always port 515).
    5. "Options Name" refers to the options entry shown above.


Last updated 05 Jan 2008