Monday, August 31, 2009

sqloopen -2079391743 sqlcode -970

I bumped into this error message (sqloopen -2079391743) when I tried to run "EXPORT" utility on a DB2 UDB table on my AIX box. No SQLCODE displayed on the screen. I couldn't find much information on the net, however, when I learnt about the DB2DIAG command, it made life easy. I issued the following command:

db2diag -rc -2079391743

and I got exactly what I was looking for:

Input ZRC string '-2079391743' parsed as 0x840F0001 (-2079391743).

ZRC value to map: 0x840F0001 (-2079391743)

V7 Equivalent ZRC value: 0xFFFFC601 (-14847)

ZRC class : Non-Critical Media Error (Class Index: 4)

Component: SQLO ; oper system services (Component Index: 15)

Reason Code: 1 (0x0001)

Identifer: SQLO_ACCD
Identifer (without component): SQLZ_RC_ACCD

Description: Access Denied

Associated information: Sqlcode -970
SQL0970N The system attempted to write to a read-only file.
Number of sqlca tokens : 0
Diaglog message number: 8701

I changed the datapath in my EXPORT command to a folder in which I had write access and the command ran fine.

Thursday, August 13, 2009

"DB2LOOK" to extract DDL from DB2 for z/OS

Many of you may be aware that "db2look" command can be used to extract DDL from DB2 UDB for LUW database. But do you know that you can use this command to extract DDL from a DB2 database for z/OS? Here is how you do it.

1. Bring up a db2cmd prompt (press Start button on your PC, click Run, type db2cmd and hit enter)
2. Connect to your mainframe DB2 subsystem using the command "db2 connectto SSID user USERID". It'll prompt for the password. Enter the password and hit enter
3. Issue the following command:
db2look -d SSID -i USERID -w PWD -e -a -l -x -p -o FILENAME.TXT

The options specified extracts the following info:

-e ==> Extract DDL statements for database objects. DDL for the followingdatabase objects are extracted when using the -e option: Tables, Views, Automatic summary tables (AST), Aliases, Indexes, Triggers, Sequences, User-defined distinct types, Primary key, referential integrity, and check constraints, User-defined structured types, User-defined functions, User-defined methods, User-defined transforms, Wrappers, Servers, User mappings, Nicknames, Type mappings, Function templates, Function mappings, Index specifications, Stored procedures

-a ==> When this option is specified the output is not limited to the objects created under a particular creator ID. All objects created by all users are considered. For example, if this option is specified with the -e option, DDL statements are extracted for all objects in the database. If this option is specified with the -m option, UPDATE statistics statements are extracted for all user created tables and indexes in the database.
Note: If neither -u nor -a is specified, the environment variable USER isused.

-l ==> If this option is specified, then the db2look utility will generate DDL for user defined table spaces, database partition groups and bufferpools.

-x ==> If this option is specified, the db2look utility will generate authorization DDL (GRANT statement, for example).

More info is available in the DB2 V8 LUW Command Reference: http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsptopic=/com.ibm.db2.udb.doc/core/r0002051.htm

Friday, July 31, 2009

How to find the number of times a CICS program was used in a day?

CICS has a very handy tool called "Statistics Utility Program" - DFHSTUP. If you want to know how many times a program was used in a particular day, run this program at the end of the day.

It prepares and prints reports offline, using the CICS statistics data recorded on the MVS system management facilities (SMF) SYS1.MANx data sets. To enable the CICS statistics domain to record interval statistics on these SMF data sets, you must specify the STATRCD=ON system initialization parameter (SIT). The other statistics record types (unsolicited, requested and end-of-day) are written regardless of the setting of the STATRCD option.

Note: Use the version of the DFHSTUP program from the same release of CICS as the data that it is to process.

Sample Job from CICS manual:

The job shown comprises of two job steps. The job steps are:

1. Unload the SMF data set (or data sets) containing the CICS statistics that you want to process
2. Run DFHSTUP to sort, format, and print the statistics data. You run the DFHSTUP program in a batch region to process any CICS SMF type 110 statistics records that are present in an unloaded SMF data set, which you can write to either a temporary or a cataloged data set.


//**********************************************************************
//* Step 1: Unload data from the SMF data sets
//**********************************************************************
//SMFDUMP EXEC PGM=IFASMFDP
//INDD1 DD DSN=SYS1.MANx,DISP=SHR,AMP=('BUFSP=65536')
//INDD2 DD DSN=SYS1.MANy,DISP=SHR
//OUTDD1 DD DSN=user.SMF.DATA,DISP=(NEW,CATLG),
// SPACE=(CYL,(50,10)),UNIT=SYSDA
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
INDD(INDD1,OPTIONS(DUMP))
INDD(INDD2,OPTIONS(DUMP))
OUTDD(OUTDD1,TYPE(0:255))
/*

//**********************************************************************
//* Step 2: Sort, format and print the statistics records
//**********************************************************************
//STUP1 EXEC PGM=DFHSTUP,REGION=0M
//********************************************
//STEPLIB DD DSN=CICSTS31.CICS.SDFHLOAD,DISP=SHR
// DD DSN=CICSTS31.CICS.SDFHAUTH,DISP=SHR
//DFHSTATS DD DSN=user.SMF.DATA,DISP=SHR
//DFHSTWRK DD UNIT=SYSDA,SPACE=(CYL,(8,4))
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(4))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(4))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(4))
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(4))
//DFHPRINT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SELECT APPLID=(applid1,applid2)
COLLECTION TYPE=ALL
/*

For more information, please refer to DFHSTUP in "CICS Transaction Server for z/OS Information Center"

Saturday, June 13, 2009

How to turn on Aux trace in CICS

The CICS INTERNAL trace stays on always. But it doesn't get externalized, so the trace data may not be available when you need it. When trace data is needed, you can turn on Aux Trace by changing the Auxiliary Trace Status to "Stopped" to "Started" using CETR transaction. The Aux Trace data set has initial value of A which is defined as DFHAUXT in the CICS started task. When A gets filled, it automatically switches to B which is defined as DFHBUXT in the started task. When B gets filled the status changes to STOPPED. You can do a STANDARD trace or a SPECIAL trace (with only the components that you want to trace - Standard usually captures lot more data than required). To set up values for special tracing, press PF4 and set the values under "special" as needed. The component abbreviations are defined in the help screen (press PF1). Once you make the required changes in this screen, press PF5 to define the transaction for which you want Aux trace turned on.


CETR CICS Trace Control Facility
CICTTOR
Type in your choices.
Item Choice Possible choices
Internal Trace Status ===> STARTED STArted, STOpped
Internal Trace Table Size ===> 400 K 16K - 1048576K
Auxiliary Trace Status ===> STOPPED STArted, STOpped, Paused
Auxiliary Trace Dataset ===> A A, B
Auxiliary Switch Status ===> NO NO, NExt, All
GTF Trace Status ===> STOPPED STArted, STOpped
Master System Trace Flag ===> OFF ON, OFf
Master User Trace Flag ===> OFF ON, OFf
When finished, press ENTER.
PF1=Help 3=Quit 4=Components 5=Ter/Trn 6=JVM 9=Error List



From the main CETR screen, press PF4 to get to the Component Trace Options screen where you can set the options for Standard and/or Special trace options.


CETR Component Trace Options
CICxxxx
Over-type where required and press ENTER. PAGE 1 OF 4
Component Standard Special
-------- --------------------------------------------------------------
AP 1 1-2
BA 1 1-2
BM 1 1
BR 1 1-2
CP 1 1-2
DC 1 1
DD 1 1-2
DH 1 1-2
DM 1 1-2
DP 1 1-2
DS 1 1-2
DU 1 1-2
EI 1 1-2
EJ 1 1-2
EM 1 1-2
FC 1 1-2
GC 1 1-2
PF: 1=Help 3=Quit 7=Back 8=Forward 9=Messages ENTER=Change



From the main CETR screen, press PF1 to get to this Trace Help screen where you can see the meanings of component abbreviations.


CETR Help: CICS Component Trace

(3) MEANINGS OF COMPONENT ABBREVIATIONS.

AP . . . Application domain IE . . . ECI over TCP/IP domain
BA . . . Business Application Manager II . . . IIOP domain
BM . . . Basic Mapping Support IS . . . ISC
BR . . . Bridge KC . . . Task Control
CP . . . CPI-C interface KE . . . Kernel
DC . . . Dump compatibility layer LC . . . Local Catalog domain
DD . . . Directory manager LD . . . Loader domain
DH . . . Document Handler domain LG . . . Log Manager domain
DM . . . Domain Manager domain LM . . . Lock Manager domain
DP . . . Debugging Profiles domain ME . . . Message domain
DS . . . Dispatcher domain MN . . . Monitoring domain
DU . . . Dump domain NQ . . . Enqueue Manager
EI . . . Exec interface OT . . . Object Transaction domain
EJ . . . Enterprise Java domain PA . . . Parameter Manager
EM . . . Event Manager domain PC . . . Program control
FC . . . File control PG . . . Program Manager domain
GC . . . Global Catalog domain PI . . . Pipeline Manager domain
IC . . . Interval control PT . . . Partner Management

PF 3=End 7=Back 8=Next ENTER=End



From the main CETR screen, press PF9 to get to this "Transaction and Terminal Trace" screen where you can set the transaction name and/or terminal name that needs to be traced.


CETR Transaction and Terminal Trace xxx
CICxxxx
Type in your choices.
Item Choice Possible choices
Transaction ID ===> Any valid 4 character ID
Transaction Status ===> STandard, SPecial, SUppressed
Terminal ID ===> Any valid Terminal ID
Netname ===> Any valid Netname
Terminal Status ===> STandard, SPecial
Terminal VTAM Exit Trace ===> ON, OFf
Terminal ZCP Trace ===> ON, OFf
VTAM Exit override ===> NONE All, System, None
When finished, press ENTER.
PF1=Help 3=Quit 6=Cancel Exits 9=Error List



To print the trace data use the following job or use IPCS to analyze the trace data.

//PRINT EXEC PGM=DFHTU640 <-- Program namechanges depending on the CICS version
//STEPLIB DD DSN=xxx.SDFHLOAD,DISP=SHR
//DFHAUXT DD DSN=xxx.DFHBUXT,DISP=SHR
//DFHAXPRT DD SYSOUT=*
//DFHAXPRM DD *
ABBREV
/*
//*TASKID=(74082)
//*TYPETR=(APE160,AP3180)

Sunday, May 24, 2009

SYSIBM.SQT* tables and SQLCODE -526

This is going to be a small post ...

If you plan to use the IBM Data Server Driver for JDBC and SQLJ or the DB2 ODBC driver, you must create the SYSIBM.SQT* Tables & SYSIBM.SQL* Stored Procs that provide support for those drivers.

GRANT ALL access to PUBLIC to these tables. Trying to GRANT individual access like GRANT SELECT won't work (you'll get SQLCODE -526).

Monday, May 11, 2009

Trace Master - CICS abend AEYB

My colleague was trying to debug a CICS program in TraceMaster (a Macro4 Prodcut). He got this message:

DFHAC2206 15:45:50 CICTTOR Transaction xxxx failed with abend AZI6. Updates to local recoverable resources backed out. DFHAC2261 System OPR sentmessage (sese code 0824089E). 'DFHAC2206 15:45:50 CICTOPR Transaction xxxx failed with abend AEYB. Updates to local recoverable resources backedout.'

CICS manual describes the condition for code "AEYB" as "INVMPSZ". This "occurs if the specified map is too wide or too long for the terminal." So I had him change the Screen Size on Trace Master profile from "2" for 24x80 to "3"for 32x80 and SAVEd the profile (this is important, Trace Master doesn'tsave the profile automatically).

That fixed the problem.

However, he started getting a "X PROG" after starting the debug session. We looked at the program source code and found what the problem was. Apparently TraceMaster doesn't like FREEKB option. It failed while executing this statement:

EXEC CICS SEND
FREEKB
CONTROL
CURSOR (EIBCPOSN)
END-EXEC.

We don't understand why the program is doing this to free the keyboard because the SEND of the map has the FREEKB option on it. This problem got resolved when we bypassed this statement while debugging in TraceMaster. This extra 'SEND CONTROL' command seems to be confusing it. To bypass this command, we set a breakpoint at this statement and then did a GOTO (PF13) to the exit to skip the SEND to get it to work.

Monday, May 4, 2009

Mainview Tips

Here are some tips if you are an user of Mainview for z/OS
  • VIEWS command gives you a list of all the VIEWs installed/available
  • Use CON xyza, where xyza is the LPAR name, command to connect to the xyza LPAR
  • Use MSG msgnumber command to get an explanation on the Error Messages displayed by Mainview. e.g., msg BBMXC739
  • Use CUST command to customize a VIEW
  • Use ASU command to update all windows automatically at a particular frequency (similar to the "&n" command in SDSF)
  • SYSSUM view shows how busy the LPAR has been in the prev intervals
  • To bring up multiple windows, use HS (Horizontal Split) or VS (VerticalSplit) to split the screen as required
  • Use CLO n, where n is the window number, to close a window
  • Use Wn;MAX to maximize window number 'n'
  • Use Wn;REST to restore the window to it's original size
  • Type SCREENS to see all the user defined screens
  • Use SCR screenname to jump to a user defined screen
  • To create your own screen, format the window as desired (multiple windows connecting to different systems etc.) and then type SAVESCR screenname
  • Summary VIEWs end with letter Z. e.g., JCPUZ
  • Long Term History data VIEWs end with letter L. e.g., JCPUL
  • If you are in a view like JCPUZ, you can scroll back and forth in time using the command TIME. Type TIME after getting into JCPUZ. Type 'TIME = = NEXT' to go to the NEXT interval and type 'TIME = = PREV' to go to the PREVious interval without changing the interval data and time. Also, you can assign them to PF keys.

Saturday, April 25, 2009

SQLCODE -904 with Reason Code "00D70024"

When you try to access or drop a table, you may get this error if the underlying VSAM data set for the table does not exist. If you are dropping the table, try dropping the tablespace instead (if there is just one table in the tablespace). If you are trying to browse the data, you are out of luck. Try recreating the table from another subsystem and load the data from there. Or, do a LOAD REPLACE with DUMMY SYSREC (it will create the underlying datasets). This will allow you access the table, but the table will be empty.

Tuesday, March 31, 2009

CA Fast Load Vs BMC Load Plus

Well, I've been compiling this for a while now. Here is a list of CA/Platinum's Fast Load utility keywords and the equivalent BMC's Load Plus keywords.


If you have any questions, or something doesn't make sense, or if you are looking for something else, please let me know (comments/email/chat).


I'm sorry, I couldn't find a way to insert a Word Document (with a table) into this blog, so I pasted the table here as an image.


Thanks !!













Friday, March 27, 2009

NULL VALUES and NULL INDICATORS in DB2

I was looking for storage space required for a column defined as WITH NULL. Got the answer here:

http://mainframe-faqs.blogspot.com/2008/02/null-values-and-null-indicators-in-db2.html

Excellent information here. Just wanted to share it with my readers here.

Thanks Arunam !!

Disclaimer:
THIS IS NOT MY OWN BLOG ENTRY. I'm just linking it to Arunam's blog entry.