View previous topic :: View next topic |
Author |
Message |
venus Beginner
Joined: 02 Jun 2006 Posts: 16 Topics: 11
|
Posted: Fri Jun 02, 2006 10:36 pm Post subject: how to identify a null value |
|
|
question 1:
in my program i coded a select statemnet. in the select iam selecting
a null coloumn. But how can i know that iam selecting a null coloumn.
question 2:
iam writing a batch progrma , which select information from table a and
update table b and c. let us suppose after updating 10000 rows job abends. what i need to do ,to make job running .( it should start updating rows from 10001) |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Mon Jun 05, 2006 9:42 am Post subject: |
|
|
Quote: |
or simply check for the SQLCODE -305
|
I would perfer to go with Null Indicator becuase when there are more than 1 columns having null values, null indicator tells which column has nulls. SQL Code -305 tells one or more of the columns are null. But does not give a direct info of exact column (unless we use DSNTIAR / analyse SQLCA structure to get to know the field number in SELECT / FETCH etc.) |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Mon Jun 05, 2006 10:33 am Post subject: |
|
|
Venus,
Some more info:
Code: |
WORKING-STORAGE SECTION.
01 WS-LITERALS.
05 ABEND-SQLCODE PIC S9(09) SIGN LEADING
SEPARATE DISPLAY.
05 NULL-IND PIC S99 COMP VALUE +0.
05 WS-DED-AMT PIC S9(09)V9(02) COMP-3.
******************************************************************
* EXECUTE SELECT QUERY *
******************************************************************
EXEC SQL
SELECT DED_AMT
INTO :WS-DED-AMT:NULL-IND
FROM TAXTABLE
WHERE EMPL_SERIAL = :WS-EMPNO
END-EXEC.
EVALUATE SQLCODE
WHEN 0
IF NULL-IND = -1
DISPLAY 'WS-DED-AMT ' WS-DED-AMT
END-IF
WHEN 100
CONTINUE
WHEN OTHER
MOVE 'SELECT FAILED FOR TAXTABLE' TO ABEND-MSG
MOVE SQLCODE TO ABEND-SQLCODE
MOVE WS-EMPNO TO ABEND-EMPNO
PERFORM 999-ABEND-ERROR THRU 999-ABEND-ERROR-EXIT
END-EVALUATE. |
_________________ Shekar
Grow Technically |
|
Back to top |
|
 |
|
|