Monday, August 28, 2006

System Abend: 0E37

PDS dataset filled all allocated directory space

Tuesday, August 01, 2006

System 806 Abend

Module not found in a library. This can occur if a new version of the module is put into a load library and is placed in secondary extents. To avoid this, when you allocate load libraries, specify a large primary allocation and 0 for the secondary allocation. This ensures that if there is not enough space, there will be an abend (for example, a B37 abend for insufficient space) when you link the module into the load library. Using this technique detects the space problem during the preparation step rather than at the run time

Friday, July 14, 2006

SQLCODE -927

The language interface was called but no connection had been made. Execute the program with the DSN command.

Friday, June 30, 2006

DB2: Fun with dates and times

To get current date, time and timestamp using SQL, reference the appropriate registers:

Select current date from sysibm.sysdummy1 ;
Select current time from sysibm.sysdummy1 ;
Select current timestampe from sysibm.sysdummy1 ;

Sysibm.Sysdummy1 is a special in-memory table that can be used to discover the value of DB2 registers as illustrated above.

Given a date, time, or timestamp, you can extract (where applicable) the year, month, day, hour, minutes, seconds, and microseconds portions independently using the appropriate function:

YEAR (current timestamp)
MONTH (current timestamp)
DAY (current timestamp)
HOUR (current timestamp)
MINUTE (current timestamp)
SECOND (current timestamp)
MICROSECOND (current timestamp)

Extracting the date and time independently from a timestamp is also very easy:

DATE (current timestamp)
TIME (current timestamp)

You can also perform date and time calculations using, for lack of a better term, English:

current date + 1 YEAR
current date + 3 YEARS + 2 MONTHS + 15 DAYS
current time + 5 HOURS - 3 MINUTES + 10 SECONDS

To calculate how many days there are between two dates, you can subtract dates as in the following:

days (current date) - days (date('1999-10-22'))

If you want to concatenate date or time values with other text, you need to convert the value into a character string first. To do this, you can simply use the CHAR() function:

char(current date)
char(current time)
char(current date + 12 hours)

To convert a character string to a date or time value, you can use:

TIMESTAMP ('2002-10-20-12.00.00.000000')
TIMESTAMP ('2002-10-20 12:00:00')
DATE ('2002-10-20')
DATE ('10/20/2002')
TIME ('12:00:00')

The TIMESTAMP(), DATE() and TIME() functions accept several more formats

Wednesday, June 21, 2006

DYNAMNBR parm

The DYNAMNBR parameter is used to indicate how many Task I/O Table (TIOT) slots to reserve for datasets that may be dynamically allocated during the job step. This parameter is equivalent to coding DD statements with the DYNAM keyowrd.

Syntax: DYNAMNBR = n

where "n" is a number in the range 0where D= no of DD stmts in the job step.

DYNAMNBR reserves space in the TIOT for the use of dynamically allocated datasets.