My favourite IDCAMS commands.

As part of my working with ADCD and having to do every system programmer task myself, it is easy to get into trouble by having all data sets cataloged in the master catalog. When you come to move to a newer level of ADCD, all of your datasets are cataloged in the old catalog.

It is better to create a user catalog for dataset you create, and create an alias, so the datasets are cataloged in your user catalog. You just have to import the catalog when you move to the newer level, and recreate the aliases and your data sets will all be visible.

I tend to use JCL like

//IBMDF JOB 1,MSGCLASS=H
// EXPORT SYMLIST=*
// SET NAME=PKISRVD
//* CHANGE THE NAME IN THE RELATE TO YOUR CATALOG
//S1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*,SYMBOLS=JCLONLY
LISTCAT ENTRIES(‘&NAME’) ALL
/*

and change the value in the SET statement.

Define a user catalog

DEFINE USERCATALOG –
( NAME(‘&NAME’) –
MEGABYTES(15 15) –
VOLUME(&VOL) –
ICFCATALOG –
FREESPACE(10 10) –
STRNO(3 ) ) –
DATA( CONTROLINTERVALSIZE(4096) –
BUFND(4) ) –
INDEX(BUFNI(4) )

List a user catalog

LISTCAT ENTRIES(‘&NAME’) ALL

Delete a user catalog

DELETE –
&NAME –
PURGE –
USERCATALOG

Create an alias to map a HLQ to a user catalog

DEFINE ALIAS (NAME(ZZZZ) RELATE(‘A4USR1.ICFCAT’) )

Delete an alias

DELETE ‘ZZZZ’ ALIAS

List alias to catalog reference

LISTCAT ENTRIES(‘ZZZZ’ ) ALL

This just tells you the alias exists and which user catalog it uses.

List all aliases in the catalog and the catalog

LISTCAT ALIAS ALL

Edit the output (option SE under SDSF) and use

  • x all
  • find alias all
  • find usercat all
  • del all x

List data sets under an alias

LISTCAT ENT(CEE.*) ALL

gives

LISTCAT ENTRIES(CEE.* ) ALL
...
ALIAS --------- CEE.SCEEBIND                                                      
     IN-CAT --- ICFCAT.PLEXH.CATALOG3                                             
     HISTORY                                                                      
       RELEASE----------------2     CREATION--------0000.000                      
     ENCRYPTIONDATA                                                               
       DATA SET ENCRYPTION-----(NO)                                               
     ASSOCIATIONS                                                                 
       SYMBOLIC-PP.ADLE370.&SYSLEVEL..SCEEBIND                                    
       RESOLVED-PP.ADLE370.ZOS204.SCEEBIND                                        

So we can see that the catalog uses system symbolics: SYSLEVEL. On the current system this is ZOS204. When zOS205 is used, the symbolic will be updated, and all of the datasets will get the new value. The resolved value (what it is now) is RESOLVED PP.ADLE370.ZOS204.SCEEBIND

My favourite TCP commands for z/OS

Console commands

Display VIPA stuff

OSPF

Either D TCPIP,,OMP,command or F OMPOUTE,command. If you use S OMPROUTE.P1, you can use F P1,command

Netstat

Netstat has two formats TSO and OMVS

  • TSO format is like NETSTAT CONN (can also be issued from operator console)
  • OMVS format is like netstat -c

There is a comparison table here

The omvs command is good for netstat -c > filename

TSO command

  1. netstat conn Displays the information about each active TCP connection and UDP socket
  2. netstat conn ( PORT 10443 who is using port 10443 Gives Foreign socket 10.1.0.2..48518 (see below)
  3. netstat allconn Provides information for all TCP connections and UDP sockets, including recently closed ones.
  4. netstat allconn ( ipport 10.1.0.2+48518 Show information about this socket coming in from 10.1.0.2 port 48518
  5. netstat all ( ipport 10.1.0.2+48518 shows all information about the remote port.
  6. netstat conn TCP TCPIP2 for TSO command for TCPIP stack TCPIP2
  7. netstat home give the IP addresses this TCPIP stack uses. For example 10.1.1.2 amd 127.0.0.1
  8. netstat Dev give stats about all interfaces
  9. netstat home report dsn ‘colin.output’ issue the home command, and write the output to ‘colin.output’
  10. netstat conn report hlq colin ( port 1414 the hlq says output the report with data set name colin.netstat.conn
  11. netstat allconn (client csq9web show all current connections (ports in use), and recent ones for the job csq9web. netstat conn just shows active ones.

OMVS

  1. netstat -c Displays the information about each active TCP connection and UDP socket
  2. netstat -c -P 10443 who is using port 10443 Gives Foreign socket 10.1.0.2..48518 (see below)
  3. netstat -a Provides information for all TCP connections and UDP sockets, including recently closed ones.
  4. netstat -a -B 10.1.0.2+48518 Show information about this socket coming in from 10.1.0.2 port 48518
  5. netstat -A -B 10.1.0.2+48518 shows all information about the remote port.
  6. netstat -c -p TCPIP2 display all connections for TCPIP jobname TCPIP2
  7. netstat -c -p TCPIP2 -P 10443 which jobs are using port 10443 – direct the request to TCPIP2 stack
  8. netstat -h give the IP addresses this TCPIP stack uses. For example 10.1.1.2 amd 127.0.0.1
  9. netstat -d give stats about all connections

Ping

TSO Ping address

USS ping address

Trace route

TSO TRACERTE address

USS traceroute address

DNS resolver

The DNS resolver maps WWW.xxx.yyy to an IP address, and an IP address to WWW.xxx.yyy.

  • F RESOLVER,DISPLAY to display the configuration
  • F RESOLVER,REFRESH,SETUP=ADCD.Z31B.TCPPARMS(GBLRESOL) to change the resolver to use the specified file. You can use SETUP=…. to specify a data set, member or Unix file.

Ubuntu commands

My favourite Z/OS commands

I’m putting together some education materials for new z/OS users, and would like a list of common or favourite commands (the commands your fingers know without having to think about them).  If you have any more useful commands, please tell me and I’ll add them.

If there is enough interest I can make the commands into html links to the online manuals – if so please let me know.

Useful links

Console commands

Managing the 3270 console

  • k a,ref shows areas on operator console
  • k a,none – removes “out of line area” from console.  You may need to do k e,d to remove the area first
  • k a,14 makes the area 14 lines deep
  • k a,6,6 makes two areas A and B, can then use D A,L,L=B for to display the command  D A,L in window B

Some commands,  eg display commands comes up in a “out of line” frame at bottom of the screen

  • k d,f scroll forward, sometimes pf8 does this. Check with d pfk
  • k e,d remove the bottom “out of line display” area

Screen

  • k q clear the backlog of queues messages
  • k e clear the scrolling messages
  • k s,ref display the current settings
  • k s,del=rd have message scroll off the top automatically
  • k s,del=n stop messages scrolling off the top
  • k e,n  remove nth message from the top of the screen – useful of the messages do not scroll.
  • d pfk
  • k n,PFk=(001,CMD=’d a,l;d ts,l’) sets the pf key to the command strings separated by ;
  • PA1 retrieve previous command

If you lose the console

Useful MVS commands

VTAM

Subsystem eg DB2, MQ

TCP

JES2

The command prefix is £ or $ depending on your system and keyboard

Commands useful when the spool has filled up

  • $DSPOOL how full is the spool
  • $D JOBDEF display the number of JOES ( Job Output elements = numbers of files) JOENUM can be increased dynamically using $T OUTDEF,JOENUM=xxxx.  Don’t forget to change it in SYS1.PARMLIB(JESPRMxx) in order to make the change permanent.
  • $DJQ,SPL=(%>1) which jobs are using more than 1% of the spool
  • $DS,SPL=(%>1) which STCs are using more than 1% of the  spool
  • $dt,spl=(%>1) which TSO are using more than 1% of the spool
  • $DJQ,DAYS>2 which jobs are more than 2 days old
  • $DO JQ,JM=CCP* display all output for jobs beginning with CCP also $DO S and $do S
  • $PO JQ,JM=CCP* Purge all output for jobs beginning with CCP also $PO S and $po S
  • $DO JQ,AGE>4 Which output data sets are more than 4 days old
  • $PO JQ,AGE>4  Purge output data sets are more than 4 days old also $PO S and $po S
  • $do jq,jm=cp7*,a>7 Which output data sets belong to cp7* and are a week old also $DO S and $do S
  • $po jq,jm=im7*,a>7 Purge output data sets belong to im7* and are a week old also $PO S and $po S

ZFS

TSO commands

  • ddlist or isrddn what are my TSO allocations – useful for looking for ISPPLIB concatentation etc
    • Line commands
      • B Browse the first sixteen data sets or a single data set.
      • E Edit the first sixteen data sets or
      • a single data set.
      • V View the first sixteen data sets or a single data set.
      • M Show an enhanced member list for the first sixteen data sets or a single data set.
      • F Free the entire DDNAME.
      • C Compress a PDS using the existing allocation.
      • I Provide additional data set information.
      • Q Display list of users or jobs using a data set.
    • Primary commands
      • Apf Browse Con CList COUnt CUstom
      • DUPlicates Enq EXclude Find Locate LOAD
      • LONg LPa Member MList  Only Parmlib
      • Reset Select SHort
    • Member name (ddstring) Scan allocations for a particular member.
    • Select modname  Search for a loaded module without searching any allocated data sets.
    • CUstom Show the values in ISPTCM and some ISPF configurations.
  • mount filesystem(‘PAICE.ABC.ZFS’) mountpoint(‘/u/paice/abc’) type(ZFS) mode(read)
  • unmount filesystem(‘PAICE.ABC.ZFS’) normal

RACF commands

What RACF data sets do I have? you can use the TSO RVARY command to display them or the operator command #RVARY, where # is the subsystem recognition character defined in the IEFSSN member for RACF.

SDSF

  • OWNER myuserid to see jobs that I own, regardless of prefix.
  • “I use ST command almost exclusively in stead of DA, O etc..”
  • SYSNAME  allows you to see jobs on another connected system
  • PREFIX abc displays jobs beginning with abc
  • filter ? allows you to select on multiple criteria owner eq paice, jobname eq MQ*
  • Sort … sort on column of data sort cpu%
  • ARRange CPU% A REAL arranges the columns so the CPU% column is displayed after the REAL column
  • Prefix commands
    • S display the spool
    • SE display in edit mode
    • C issues JES command to cancel the job
    • ? displays the different output files within the job
    • SJ allows you to edit the JCL and resubmit it
  • log s display the system message log for your MVS system.
  • log o displays the merged, sysplex-wide system message log
  • ulog displays the output from commands you have issued

MQ using CSQUTIL or equivilant command

SMF

SMS – ISMF

  • Display all options on the ISMF panel 0 ISMF Profile.0 User Mode Selection  set to 2 For a Storage Administrator (SA)
  • To tailor columns displayed, used view command, specify columns and save it
  • Display disks and information about disks  2 Volume.1 Dasd ,
    • Acquire Physical Data Y,
    • Storage Group Name ” “
    • CDS Name ” “
    • Press enter
  • Display storage group name , 6 Storage Group, 1. List
    • and disks in the storage group 1. List,  then line operator listvol

TASID

TASID is a “monitor” tool developed internally within IBM to monitor activity on a z/OS system. It is displayed in ISPF on TSO.     It displays IPL info, storage usage, address space usage etc.   Think of unix “top” function.

Note that some options may not  operate correctly on all z/OS systems. Download it from IBM here.

USS Unix services

  • ls -T file display file tag, ASCII, EBCDIC etc ISO8859-1 is ASCII, code page, codepage
  • chtag -p display/change file tag info
  • chtag -t -c ISO8859-1 filename  change the filename to be oeditable
  • whence name like which name, tells you where a command came from eg whence oedit is /bin/oedit
  • tar  like zip
  • cp copy files
  • find
    • find . -name *.sh all files of type .sh in the current directory
    • find . -mtime +1 all files in the current directory modified older than one day ago
    • find . -mtime -1 all files in the current directory modified less than one day ago
    • find . -mtime 4 all files in the current directory modified exactly 4 days ago
    • find . -ctime 3 all files with attributes change exactly 3 day ago
    • find . -atime -1 all files in the current directory accessed less than one day ago. Though I do not see how this works in a R/O file system across IPLs
    • find . -mtime -1 -a -type f files modified less than 1 day ago, and it is a regular file. -type d for dictionary
  • mkdir 
  • mkdir -p and the intermediate directories
  • pax another way of packing files to make them portable. It keeps meta data.
    • pax -W “seqparms=’space=(cyl,(30,30))'” -wzvf “//’COLIN.PAX.CONSOLE'” -x os390 *.c *.h *.s *.py to create a dataset with the contents.
    • pax -vf “//’COLIN.PAX.CONSOLE'” *.s to list the dataset, matching *.s
    • pax -rvf “//’COLIN.PAX.CONSOLE'” *.s to read the dataset matching *.s
    • tar -tf myfile.pax To display contents of a pax file.  This can be used on Linux.
    • tar -xf myfile.pax  name.type To extract name.type from a pax file. It keeps the directory structure from the pax file.
  • TSO OMVS command for example the ESCape NOPFSHOW
  • du -ska . display summary of the size of each file below ‘.’ directory in 1KB blocks
  • du -ka . display the size of each file below ‘.’ directory in 1KB blocks.
  • du -ka /u/paice gives the space on the directory
  • du -ka /u/paice/* gives the space on the files within the directory
  • du -ka . | sort display the size of each file below ‘.’ directory in 1KB blocks sorted in ascending size.
  • cksum file  gives a checksum of a file, and number of bytes in the file.  There is the same command on Linux.  See here for commands on other platforms.
  • od -t cx1 colin.conf > ab display a file in text and hex. x1 says one byte hex number. x4 is as an int.
  • umask set or display the default permissions mask for when creating a unix file.

WAS, Liberty,

Angel processes

Liberty

WLM

D WLM.

V WLM,POLICY=….

SLIP – to take an action when something happens

  • D SLIP
  • D SLIP=0001
  • SLIP SET,MSGID=BPXM023I,ACTION=SVCD,END
  • SLIP MOD,ENABLE ,ID=trapid
  • SLIP MOD,DISABLE,ID=trapid
  • SLIP SET,COMP=122,ACTION=SVCD   for system abend code 122
  • SLIP SET,IF,RANGE=(2060825A,2060825C),JOBNAME=PYT, ACTION=SVCD take a dump when in the range. Jobname can be started task name.

OMVS

IPCS

  • LIST 20608252. ASID(X’0047′) LENGTH(X’1000′) INSTRUCTION display the data in instruction
  • LIST 20608252. ASID(X’0047′) LENGTH(4096) str give the value with character representation