What I'm Thinking

Handling NULL in DB2
20 January 2012

The value of an indicator variable tells the status of a row after a query. Host Variable: 01 FILLER. 05 WS-AMOUNT PIC S9(5)V9(2) COMP-3. 05 WS-CUSTNUM PIC X(5). Indicator variable: 01 FILLER. 05 AMT-IND PIC S9(4) COMP. Consider the below SQL. EXEC SQL SELECT CUST_AMOUNT INTO :WS-AMOUNT:AMT-IND FROM T100.CUST WHERE CUST_ID = :WS-CUSTNUM END-EXEC. After a query, the indicator variable contains the following: 0 - Column is not null -1 - Column is null -2 - Column is null as result of conversion error +length - Full length of column that was truncated to fit a short host variable Some points to ponder: ... Read More

Isolation level in DB2
20 January 2012

The list of isoloation leves are listed below. SERIALIZABLE(Repeatable read (RR)) REPEATABLE READ(Read stability (RS)) READ COMMITTED(Cursor stability (CS)) (default) READ UNCOMMITTED(Uncommitted read (UR)) SERIALIZABLE (DB2 UDB: Repeatable Read) Locks the table within a unit of work. An application can retrieve and operate on rows in the table as many times as needed. However, the entire table is locked, not just the rows that are retrieved. Until the unit of work completes, no other application can update, delete, or insert a row that would affect the table. ... Read More
While working in MS Excel we have the option of “Freeze Panes”. By this options we can freeze some columns and have other columns scrolling. This feature is helpful in analysis when there are lots of columns(fields) in a file. In mainframe too, we have similar such facility thru File-Aid. Open the file in File-Aid Use VFMT format If you want to freeze columns(fields) 1,2,3, and 6 and have the rest as scrollable issue the below command. ... Read More
Whats the best way to count the number of records in a VSAM File? Choose FILE-AID Option 3.8. At the prompt of ….ENTER NEXT FUNCTION OR END , enter TALLY. You will get the record count. Type END to exit.

Read Only VSM Files
20 January 2012

By using INHIBIT along with ALTER command, we can have a read-only VSAM dataset. Example: //STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * ALTER – SECRET.KSDS.DATA – INHIBIT ALTER – SECRET.KSDS.INDEX – INHIBIT /* Notice that the ALTER command is used with DATA and INDEX and not with the cluster.