DB2 Unload and Nulls Question

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
lfong
Premium Member
Premium Member
Posts: 42
Joined: Fri Sep 09, 2005 7:48 am

DB2 Unload and Nulls Question

Post by lfong »

I have a data source that is an unload of a db2 table. I am using the FTP stage to bring the data over to the server and CFF stage to convert the data from ebcdic to ascii. I have imported the COBOL portion of the dclgen to use as my layout for the conversion..
I have several fields on my source that are defined as nullable. The null indicator for COBOL is a S9(4) COMP field which is added after the column (a negative value here signifies that the data value is null); but the unload will place the null indicator before the column and it will contain a '?', if the field is null. This is a sample of what the COBOL representation of the dclgen looks like:

10 FLD1 PIC X(10).
10 FLD2-NULL-INDGRP-ID-IND PIC S9(4) USAGE COMP.
10 FLD2 PIC S9(4) USAGE COMP.
10 FLD3-NULL-IND PIC S9(4) USAGE COMP.
10 FLD3 PIC S9(4) USAGE COMP.
10 FLD4-NULL-IND PIC S9(4) USAGE COMP.
10 FLD4 PIC X(10).
10 FLD5-NULL-IND PIC S9(4) USAGE COMP.
10 FLD5 PIC S9(4) USAGE COMP.

I know that in row properties in the datastage manager I can set the properties for each row to accommodate null values. Would I just need to set the null string (with or without quotes), or do I have to set the datatype and padding as well. If so, what would the padding value be.
Post Reply