IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

reg : Handle Null Vals from Batch while loading using BMC ut


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MoganaKumaran

New User


Joined: 26 Jun 2007
Posts: 20
Location: Chennai

PostPosted: Tue May 03, 2011 5:29 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue May 03, 2011 7:07 pm
Reply with quote

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
View user's profile Send private message
MoganaKumaran

New User


Joined: 26 Jun 2007
Posts: 20
Location: Chennai

PostPosted: Tue May 03, 2011 7:35 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue May 03, 2011 7:54 pm
Reply with quote

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
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue May 03, 2011 9:03 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Batch install term/printer CICS 2
Search our Forums:

Back to Top