In a COBOL INITIALIZE statement, elementary FILLER items are ignored. That means, INITIALIZE does not touch the values in the FILLER.
e.g.,
01 WS-VAR.
05 FILLER PIC X(5) VALUE 'junk1'.
05 WS-FILLER PIC X(5) VALUE 'junk2'.
05 FILLER PIC X(5) VALUE 'junk3'.
After the statement INITIALIZE WS-VAR is executed, FILLER contains 'junk' ,whereas WS-FILLER contains all spaces.
Effectively, WS-VAR changes from 'junk1junk2junk3' to 'junk1 junk3'.
Technical Tips including DB2 z/OS, DB2 LUW, COBOL, JCL, VSAM, CICS, 3rd party vendor tools (BMC, CA, IBM, Macro4, etc.)
Saturday, January 31, 2009
Sunday, January 25, 2009
DB2 "OPTIMIZE FOR 1 ROW"
Use this clause to avoid sorts - You can influence the access path most by using OPTIMIZE FOR 1 ROW.
OPTIMIZE FOR 1 ROW tells DB2 to select an access path that returns the first qualifying row quickly. This means that whenever possible, DB2 avoids any access path that
involves a sort.
In "OPTIMIZE FOR n ROWS", if you specify a value for n that is anything but 1, DB2 chooses an access path based on cost, and you won't necessarily avoid sorts.
OPTIMIZE FOR 1 ROW tells DB2 to select an access path that returns the first qualifying row quickly. This means that whenever possible, DB2 avoids any access path that
involves a sort.
In "OPTIMIZE FOR n ROWS", if you specify a value for n that is anything but 1, DB2 chooses an access path based on cost, and you won't necessarily avoid sorts.
Wednesday, January 21, 2009
SDSF POS Field
I used to sort the jobs by POS (position) field in SDSF. This puts all the jobs in ascending order by date and time except the jobs that are in input queue or that are currently executing - they always appear in the top.
However, we recently upgraded from z/OS 1.8 to z/OS 1.9 and I don't see it sorted this way any more and the POS field is not populated by any value either. So I asked my sys prog and she asked IBM.
IBM's answer is here:
"The difference your seeing is described by the HOLD data for APAR OA26013 now PE'd by OA27126. The difference in behavior on the panel has to do with a change in the way SDSF gets the jobs/data for the panel. Previously, SDSF read the data from spool which meant running thru the queues and calculating the POS field on its own. These POS values were calculated erroneously by SDSF, assigning a position value to jobs on all queues.
Starting in SDSF 1.9, we're using JES2 SSI calls to acquire the job information which returns the correct POS values assigned by JES2. The POS field on the SDSF ST panel only applies to jobs on the INPUT queue, that is, jobs in-and-awaiting execution, not to any other queues like OUTPUT, SPIN and HARDCOPY.
These changes were necessary to expand support for SDSF to include JES3 compatibility and is considered working as designed."
So, now I'm sorting my jobs by ST-DATE and ST-TIME which is not the same as sorting on POS but comes a little close to that. I miss my POS field :(
However, we recently upgraded from z/OS 1.8 to z/OS 1.9 and I don't see it sorted this way any more and the POS field is not populated by any value either. So I asked my sys prog and she asked IBM.
IBM's answer is here:
"The difference your seeing is described by the HOLD data for APAR OA26013 now PE'd by OA27126. The difference in behavior on the panel has to do with a change in the way SDSF gets the jobs/data for the panel. Previously, SDSF read the data from spool which meant running thru the queues and calculating the POS field on its own. These POS values were calculated erroneously by SDSF, assigning a position value to jobs on all queues.
Starting in SDSF 1.9, we're using JES2 SSI calls to acquire the job information which returns the correct POS values assigned by JES2. The POS field on the SDSF ST panel only applies to jobs on the INPUT queue, that is, jobs in-and-awaiting execution, not to any other queues like OUTPUT, SPIN and HARDCOPY.
These changes were necessary to expand support for SDSF to include JES3 compatibility and is considered working as designed."
So, now I'm sorting my jobs by ST-DATE and ST-TIME which is not the same as sorting on POS but comes a little close to that. I miss my POS field :(
Saturday, January 10, 2009
CICS EIBRESP=27
Last week I was coding a simple CICS program and in the first execution, I got this error message:
EIBRESP=27 and EIBRESP2=0
As per the CICS manual, EIBRESP=27 means "Length Error". Well I found it strange that it got a
length error. After analyzing further I found that, I forgot to define the program in CICS. I defined it in CICS and then ran the program again, it started working !!
Why wouldn't CICS give me a straight forward "I cannot find this program in CICS" instead saying "Length Error"?
Well, the problem is solved now, I'm not worried about it anymore.
EIBRESP=27 and EIBRESP2=0
As per the CICS manual, EIBRESP=27 means "Length Error". Well I found it strange that it got a
length error. After analyzing further I found that, I forgot to define the program in CICS. I defined it in CICS and then ran the program again, it started working !!
Why wouldn't CICS give me a straight forward "I cannot find this program in CICS" instead saying "Length Error"?
Well, the problem is solved now, I'm not worried about it anymore.
Friday, January 9, 2009
DB2 SQLCODE -497
If you get an SQLCODE -497 while trying to run a QMF PROC, read this:
SQLCODE -497 means "THE MAXIMUM LIMIT OF INTERNAL IDENTIFIERS HAS BEEN
EXCEEDED FOR DATABASE database"
You need to run the MODIFY utility with RECOVERY option to fix this issue.
The MODIFY online utility with the RECOVERY option deletes records from the SYSIBM.SYSCOPY catalog table, related log records from the SYSIBM.SYSLGRNX directory table, and entries from the DBD. You can remove records that were written before a specific date or you can remove records of a specific age. You can delete records for an entire table space, partition, or data set.
Sample SYSIN for MODIFY:
MODIFY RECOVERY TABLESPACE database.tablespace DELETE AGE(365)
SQLCODE -497 means "THE MAXIMUM LIMIT OF INTERNAL IDENTIFIERS HAS BEEN
EXCEEDED FOR DATABASE database"
You need to run the MODIFY utility with RECOVERY option to fix this issue.
The MODIFY online utility with the RECOVERY option deletes records from the SYSIBM.SYSCOPY catalog table, related log records from the SYSIBM.SYSLGRNX directory table, and entries from the DBD. You can remove records that were written before a specific date or you can remove records of a specific age. You can delete records for an entire table space, partition, or data set.
Sample SYSIN for MODIFY:
MODIFY RECOVERY TABLESPACE database.tablespace DELETE AGE(365)
Saturday, December 27, 2008
Dataset ENQ and CONtention
If you are trying to edit or view a dataset and you get a message "data set in use", how will you find who is using it? ISRDDN is the answer.
Type TSO ISRDDN (in some shops its just ISRDDN - no TSO prefix required) and hit enter. Then type ENQ and hit enter.
You will get a screen like this:

Type your dataset name (or prefix) in "Minor name prefix" and hit enter.
You'll get a list of all the users/jobs that are viewing/editing the
dataset(s) under the Job Name field. These are color coded to indicate the following ENQue status:
GREEN - Shared
REVERSE GREEN - Waiting for shared
RED - Exclusive
REVERSE RED - Waiting for exclusive
For the System ENQ List you may specify specific Major, and Minor prefixes, as well as specific job or user prefixes to reduce the size of the list.
You can use the RESET command to reset these values to defaults.
On the ENQ display screen, you can type ALL to view all system ENQs or RESET to view the SYSDSN enqs for your user id.
The System ENQ Contention display (command Con) shows all ENQ contention on the system.
Type TSO ISRDDN (in some shops its just ISRDDN - no TSO prefix required) and hit enter. Then type ENQ and hit enter.
You will get a screen like this:

Type your dataset name (or prefix) in "Minor name prefix" and hit enter.
You'll get a list of all the users/jobs that are viewing/editing the
dataset(s) under the Job Name field. These are color coded to indicate the following ENQue status:
GREEN - Shared
REVERSE GREEN - Waiting for shared
RED - Exclusive
REVERSE RED - Waiting for exclusive
For the System ENQ List you may specify specific Major, and Minor prefixes, as well as specific job or user prefixes to reduce the size of the list.
You can use the RESET command to reset these values to defaults.
On the ENQ display screen, you can type ALL to view all system ENQs or RESET to view the SYSDSN enqs for your user id.
The System ENQ Contention display (command Con) shows all ENQ contention on the system.
Thursday, December 11, 2008
Fast Load abend - IEC146I 513-04
You are running Platinum Fast Load job and the job fails on you with an "IEC146I 513-04" error.
IEC146I 513-04 means
"An OPEN macro instruction was issued for a magnetic tape data set allocated to a device that already has an open data set on it. Make sure that the first data set is closed before the second is opened, or allocate the second data set to a different device. This error may be due to a
previous abnormal end associated with the same unit in the same step. If so, correct the error causing the previous abnormal end."
Problem:
As per the above message, you are trying open the dataset for two different purposes in the same job step.
In your LOAD card, see what you've specified for INDDN. In my case, I had specified INDDN SYSREC.
Fast Load user guide says "If you will be performing an OUTPUT-CONTROL ALL type load, and you want to specify INDDN SYSREC, you must also specify UNLDDN and change its default value. Otherwise, Unicenter Fast Load will try to use SYSREC as an input and a work file."
OUTPUT-CONTROL ALL is the default. I noticed that I didn't have a UNLDDN DD name in my JCL.
Fix:
Either specify a UNLDDN DD in your JCL step or change INDDN to something other than SYSREC. I changed it to SYSULD and it worked.
IEC146I 513-04 means
"An OPEN macro instruction was issued for a magnetic tape data set allocated to a device that already has an open data set on it. Make sure that the first data set is closed before the second is opened, or allocate the second data set to a different device. This error may be due to a
previous abnormal end associated with the same unit in the same step. If so, correct the error causing the previous abnormal end."
Problem:
As per the above message, you are trying open the dataset for two different purposes in the same job step.
In your LOAD card, see what you've specified for INDDN. In my case, I had specified INDDN SYSREC.
Fast Load user guide says "If you will be performing an OUTPUT-CONTROL ALL type load, and you want to specify INDDN SYSREC, you must also specify UNLDDN and change its default value. Otherwise, Unicenter Fast Load will try to use SYSREC as an input and a work file."
OUTPUT-CONTROL ALL is the default. I noticed that I didn't have a UNLDDN DD name in my JCL.
Fix:
Either specify a UNLDDN DD in your JCL step or change INDDN to something other than SYSREC. I changed it to SYSULD and it worked.
Monday, December 1, 2008
CA Intertest (Batch) Tips
If you use CA's Intertest for Batch to debug your batch COBOL programs or stored procedures, read on.
There are a few commands that you use frequently. Set them commands in PFKEYS for ease of use:
STEP 1 - Set steps to go in each run to 1 (I usually set it to PF4)
GO - Run as many steps as described in the STEP command (I usually set it to PF5)
RUN - Run until the next breakpoint (I usually set it to PF6)
KUP - Scroll Up in the Data Display Window (I usually set it to PF17)
KDOWN - Scroll Down in the Data Display Window (I usually set it to PF18)
There are a few commands that you use frequently. Set them commands in PFKEYS for ease of use:
STEP 1 - Set steps to go in each run to 1 (I usually set it to PF4)
GO - Run as many steps as described in the STEP command (I usually set it to PF5)
RUN - Run until the next breakpoint (I usually set it to PF6)
KUP - Scroll Up in the Data Display Window (I usually set it to PF17)
KDOWN - Scroll Down in the Data Display Window (I usually set it to PF18)
Labels:
CA,
COBOL,
Computer Associates,
Mainframe,
Stored Procedure
Thursday, November 20, 2008
Sample Job: CA/Platinum Fast Unload
Here is a sample job to run CA/Platinum Fast Unload utility:

Labels:
CA,
Computer Associates,
Fast Unload,
Job,
Platinum
Subscribe to:
Posts (Atom)