2010年7月23日 星期五

Access MVS control blocks from a COBOL program

Mainframe Express enables you to access MVS control blocks from a COBOL program. The following sample program shows how you can access the job, step, and program names for the currently running program.

       IDENTIFICATION DIVISION.
PROGRAM-ID. JOBINFO.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 JOB-NAME PIC X(8).
01 PROGRAM-NAME PIC X(8).
01 STEP-NAME PIC X(8).

LINKAGE SECTION.
01 PSA.
05 FILLER PIC X(540).
05 PSATOLD POINTER.

01 TCB.
05 FILLER PIC X(12).
05 TCBTIO POINTER.
05 FILLER PIC X(164).
05 TCBJSCBB POINTER.

01 TIOT.
05 TIOCNJOB PIC X(8).
05 TIOCSTPN PIC X(8).

01 JSCB.
05 FILLER PIC X(360).
05 JSCBPGMN PIC X(8).

PROCEDURE DIVISION.
* Address PSA
SET ADDRESS OF PSA TO NULL

* Address TCB
SET ADDRESS OF TCB TO PSATOLD

* Address TIOT
SET ADDRESS OF TIOT TO TCBTIO

MOVE TIOCNJOB TO JOB-NAME
MOVE TIOCSTPN TO STEP-NAME

* Address JSCB
SET ADDRESS OF JSCB TO TCBJSCBB

MOVE JSCBPGMN TO PROGRAM-NAME

DISPLAY 'JOB NAME = ' JOB-NAME
DISPLAY 'STEP NAME = ' STEP-NAME
DISPLAY 'PROGRAM NAME = ' PROGRAM-NAME
GOBACK
.

2010年7月21日 星期三

You can look up any z/OS or z/VSE message easily on-line

Do you want to know where you can look up any z/OS or z/VSE message easily on-line?

http://www-03.ibm.com/systems/z/os/zos/bkserv/lookat/

Communicate with CICS from SDSF

To be able to communicate with CICS from SDSF, you need to install a terminal into the CICS region with the CONSNAME attribute set to that of your TSO userid. You can find out a little more on how to define this here:

https://publib.boulder.ibm.com/infocenter/cicsts/v4r1/topic/com.ibm.cics.ts.resourcedefinition.doc/terminals/dfha23q.html

z/OS Tutorials and Cookbooks

* Fake Your Way - Unix & MVS Book http://www.snee.com/bob/opsys.html

* Free Tutotials from IBM http://www-128.ibm.com/developerworks/training/tutorials.html

* Free eserver articles from IBM http://www-106.ibm.com/developerworks/eserver/tutorials.html

* IBM Z/OS Basics http://publibz.boulder.ibm.com/zoslib/pdf/zosbasic.pdf

* Systems Programmer's Guides

o Intro., Storage, HCD, Delivery http://www.redbooks.ibm.com/abstracts/sg245597.html?Open

o Software and Architecture http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg245597.html?Open

o config, IPL and run OS/390 http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg245652.html?Open

o storage management, files, OS maintenance http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg245653.html?Open

o TCP/IP, SNA, LE, RACF, USS http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg245654.html?Open

o ARM, GRS, LOGGER, HMC, WLM, Diagnosis http://publib-b.boulder.ibm.com/Redbooks.nsf/RedbookAbstracts/sg245655.html?Open

o z/Architecture HCD GRS, WLM, Parallel Sysplex, error diagnosis http://publib-b.boulder.ibm.com/Redbooks.nsf/RedpieceAbstracts/sg246990.html

o RACF, LDAP, Unix, TCP/IP, LPAR http://www.redbooks.ibm.com/abstracts/sg246983.html?Open

* OS/390 (and z/OS) New Users Cookbook, SG24-6204-00 http://www.redbooks.ibm.com/redbooks/SG246204.html

* e-business Cookbook for z/OS Volume I - Technology Introduction http://www.redbooks.ibm.com/redbooks/SG245664.html

* e-business Cookbook for z/OS Volume II – Infrastructure http://www.redbooks.ibm.com/redbooks/SG245981.html

* e-business Cookbook for z/OS Volume III - Java Development http://www.redbooks.ibm.com/redbooks/SG245980.html

* ABCs of Systems Programming Vol. 1- Storage,TSO/E, ISPF http://www.redbooks.ibm.com/abstracts/sg246981.html

* ABCs of Systems Programming Vol. 2- Implementation http://www.redbooks.ibm.com/abstracts/sg246982.html

* ABCs of Systems Programming Vol. 3- SMS - Storage VSAM http://www.redbooks.ibm.com/abstracts/sg246983.html

* ABCs of Systems Programming Vol. 9- Unix http://www.redbooks.ibm.com/redpieces/abstracts/sg246989.html

* ABCs of Systems Programming Vol 10.- Zseries,LPAR,HCD http://www.redbooks.ibm.com/abstracts/sg246990.html

2010年7月13日 星期二

Issue Console command from REXX

Sample REXX program as:

/* REXX - issue console command */
address TSO 'CONSPROF SOLDISPLAY(NO)'
address TSO 'CONSOLE ACTIVATE'

address CONSOLE 'D TS,L'
/* address CONSOLE 'D R,,,MSG=DFS8' */

/* RETRIEVE OUTPUT COMMAND */
do forever
fc = getmsg('line.','sol',,,10)
if fc = 0 then leave
end
address TSO 'CONSOLE DEACTIVATE'

/* Search for &SA. */
do i=1 to line.0
say line.i
end

REXX to list PDS member information

Simple REXX program to list PDS member information:

/*rexx*/

dsn = "PETERT.HC.REXX"

DUMMY =OUTTRAP("MEMB.","*")

"LISTDS '"dsn"' MEMBERS"

do i = 1 to memb.0

if SUBSTR(strip(memb.i),1,3) = 'LIS' then

say "memeber :" memb.i

end