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

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=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

11 thoughts on “My favourite Z/OS commands

  1. Thanks Colin. I tried these out on my Sandbox today. Although I could not use the ones which are not allowed on an extended MCS console, the rest of them worked great.

    Like

    1. Jake

      Thanks for taking the time to tell me. It is good to get feedback and know my blog posts are useful. If you need any help with zPDT which the community cannot help with, please feel free to contact me.

      Like

  2. Thank you for this Blog, this helped me to go through commands quickly which are used in BAU, I am glad to know that you worked in IBM, Now I am working in IBM as a senior operator.

    Like

  3. Hi Colin, I used your blog quite frequently and this is my first post to your blog. I’m new to z/OS and was stumped on why there’s no output. I used your frequented command =s.st and found them and they’re in PRINT queue.

    Thanks and keep up the good work.

    Like

    1. I’m glad you find it useful… If you find other commands you frequently use, please let me know. Also, if there are other areas of z/OS that you could do with help on ( just to get started) please let me known and I’ll see what I can do.

      Like

Leave a comment