View previous topic :: View next topic
|
Author |
Message |
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
I have a COBOL DB2 program which extracts data for reporting purpose from different tables and loads data (Use BMC load) into a report table.
The tables(fields) from which data extracted sometimes can be null and the same null value needs to be loaded into the report table . So I have used
null indicators in my output record to capture values for all nullable fields in the report table .
I have used PIC S9(4) USAGE COMP to handle all the null indicator valuesin the output file .
Ex.
Market rec
fld-a
fld-b
fld-b-nul
fld-c
fld-c-null
etc
When I unload the data from my report table it has LRECL of 488.
My program output fields along with null indicator fields has LRECL of 513
I am worried if my load would fail.
I need to how null indicators are handled and how they can be loaded in to the target table (fields that can accept null).
Regards,
Mohan |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
You ought to begin by comparing the load control cards generated by BMC Unload+ to your COBOL record layout to see where the differences lie and whether they are significant. |
|
Back to top |
|
|
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
I have compared the control card genreated from BMC unload with the output file generated from batch output.
There is a difference and its trying to load data in different position.
The reason being .
I use following layout along with null indicator fields:
mkt-rec
fld-a
flda-null
fld-b
fld-b-null
... etc
The pattern generated from BMC unload is like this
mkt-rec
fld-a
fld-b
Due to this I m getting error while i m loading. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
No, you don't use that layout; that is not valid COBOL code. And BMC doesn't generate those data, as those are not valid load control cards.
As you can't be bothered to tell the truth, I can't be bothered to help you. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
BMC unload must generate some null indicators somewhere.
and your punch file should have them as well.
something like
Code: |
, "COLUMN1" POSITION( 00030:00035) CHAR(00005)
NULLIF(00029)=X'FF' |
If it looks like this, you should "handle all the null indicator values in the output file" as a PIC x(1) in which you would move HIGH-VALUES when null and LOW-VALUES when not null and place indicators before the column (=pos 29).
the difference 488 - 513 is probably that you defined 25 null indicators as
PIC s9(4) comp (=2 bytes) and a normal unload file uses PIC X (= 1 byte). |
|
Back to top |
|
|
|