Friday, October 23, 2015

Few Shell Commands

skulker [-irw] [-l logfile] directory days_old 


Removes files in directory older than specified number of days

shell script in /samples ƒ 

- copy to /bin/skulker or /usr/sbin/skulker ƒ 
- can be modified by installation ƒ 
- Protect it from hackers! (make it non-writable) 

e.g. skulker /tmp/ 100 ƒ

deletes files in /tmp older than 100 days ƒ
trailing slash follows a /tmp symlink to another directory

- use cron to schedule it to run regularly

fuser [-cfku] file ... 

- List process IDs of processes with open files ƒ
- Useful for finding the current users of a file, or a filesystem (e.g. before unmount) ƒ
- e.g. fuser -cu /usr/lpp/dfs shows who is using the containing filesystem

uptime 

-ƒ Display how long the system has been IPLed ƒ
- e.g. uptime 01:02PM up 14 day(s), 01:15, 58 users, load average: 0.00, 0.00, 0.00

Finding file opens in Unix

rbd2/u/drbd:>fuser -u $LOGS/evtlog.2016-04-12
/plex/var/trb/rbd2/dps1/logs/evtlog.2016-04-12: 33620442(DRBD)
rbd2/u/drbd:>ps -p 33620442
       PID TTY       TIME CMD

  33620442 ?         1:09 /plex/var/trb/rbd2/dps1/lib/sislib/sievtq.exe

Z/OS Unix Environment


1. Programs using OSS, is normally written in REXX or C Language.
2. Languages "Transform" into USS assembler callable services (syscalls) via the POSIX API.
3. Assembler services can be called directly too. 

Basic Terminology in Z/OS Unix Services

USS         – z/OS UNIX System Services „

Process    – program using UNIX system services „

Thread  – a unit (task) of work in a process „

Dub        – establish a z/OS UNIX environment for an address space z create process „

Fork/Spawn – methods by which a parent process creates a child process „

Syscall / System Call / Callable Service z a request by an active process for a service to be performed by z/OS UNIX System Services „

Zombie – address space with OMVS resources remaining after dubbed process terminates


Facts and Advantages of Z/OS Unix

Fast facts about z/OS UNIX

  • It is a certified UNIX system and an integral element of z/OS. 
  • WebSphere® Application Server, CICS®, IMS™ , Java™  Runtime, Tuxedo, DB2®, WebSphere MQ, SAP R/3, Lotus Domino, and Oracle Web Server all use z/OS UNIX.
  • z/OS UNIX applications can communicate with DB2®, CICS, IMS, and WebSphere MQ. WebSphere Application Server on z/OS using the Optimized Local Adapters support (WOLA) provides direct communication between z/OS UNIX applications and Websphere Application Server applications on z/OS.
  • z/OS UNIX is built for the enterprise where you can prioritize workloads for high performance when running with a mixed workload.
  • There is a broad range of ISV applications ported to z/OS UNIX.
  • z/OS UNIX has a hierarchical file system familiar to UNIX users.
  • Applications can work with data in both  the z/OS UNIX file systems and traditional MVS™ data sets.  MVS programs can access UNIX files, and UNIX programs can access MVS data sets. 
  • The SMB File and Print Server enables a distributed file sharing infrastructure for z/OS UNIX files and Windows® workstations.
  • Users can choose which interface they want to use: the standard shell, 3270, or the ISPF interfaces.
Advantages of Z/OS Unix
  • z/OS applications can take advantage of all the enterprise services
  • Extensive support in the marketplace
  • Enterprise-class applications and middleware
  • Access to advanced security features of RACF®
  • Access to the two-phase commit protocol provided by Resource Recovery Services (RRS)
  • Workload Manager to manage the allocation of physical resources to maximize system responsiveness.
  • High performance Database Access

z/OS UNIX and traditional UNIX


z/OS UNIX systemTraditional UNIX system
  • Manage and secure system resources from a single point.
  • Consistently runs near 100% utilization.
  • WLM gives UNIX applications extra resources to manage tasks.
  • Manage and secure each system's resources individually.
  • A dedicated UNIX system usually runs at about 50-70% utilization.
  • Without any job management, traditional UNIX systems can become disabled.

Thursday, October 22, 2015

Z/OS Unix System Services - II

OMVS provides a shell interface where you can type UNIX commands, as shown in below figure.



By default, you type commands close to the bottom, at the ===> prompt (it is possible to configure OMVS to place the ===> prompt at the top instead).

Can we do our "Hello, World" example as a z/OS UNIX program? Sure! Let's do it in the C programming language. Start by using OEDIT, which is the ISPF editor for z/OS UNIX:

You are now in an editor that is very similar to the editor that you used to edit your JCL. This time, enter the "Hello, World" program, as shown in the below figure. 

Now compile and execute the program:

c89 –o test test.c

./test

If the compiler fails, type exit from OMVS and LOGOFF from TSO.
Then when you log back on, type 2096128 in the size field of the TSO logon panel.

Note that the C compiler is a separate product from OMVS, and your site might not have it.


When you are done with OMVS, use exit to leave it.

Z/OS Unix Services

Many changes have occurred in the world of computing since the announcement of System/360 in 1964.

Among the many significant changes is the development of the UNIX operating system by employees at AT&T's Bell Labs in the 1960s.

Although UNIX has concepts such as processes and threads, which are analogous to z/OS concepts such as address spaces and tasks, many significant differences exist.

For example,
  - In UNIX, files are byte-oriented streams of data,
  - But in z/OS, files (data sets) are record oriented.

../Pict/coursefocus/Ef_UNIX.gif

Within z/OS, you have a complete UNIX environment with z/OS UNIX System Services. 
This UNIX environment is integrated with the "traditional" z/OS environment. For example, you can access a z/OS UNIX file from a batch job and you can access a data set from a z/OS UNIX application.

You can enter the world of UNIX from z/OS in several ways. 

- From TSO, you can enter the z/OS UNIX environment using the OMVS command from the TSO READY prompt.

- Within the ISPF environment, you can type the command tso omvs to enter UNIX (in general, you can run any TSO command from ISPF by prefacing it with tso).

Why OMVS?

When IBM first added the UNIX environment to MVS, it was called Open Edition, with the "Open" designating this environment and set of interfaces as one that was not designed or owned by IBM.

The logical extension of this is Open MVS, which was shortened to the command OMVS. You can see vestiges of this naming convention in the OMVS command, the OMVS segment in user profiles, and the z/OS UNIX "O" commands, such as OGET, OPUT, and OEDIT.