 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to handle Null value in COBOL/400.</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 15:58:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: The Most-Watched IT Questions: May 24, 2011 - ITKE Community Blog</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-92545</link>
		<dc:creator>The Most-Watched IT Questions: May 24, 2011 - ITKE Community Blog</dc:creator>
		<pubDate>Tue, 24 May 2011 06:41:36 +0000</pubDate>
		<guid isPermaLink="false">#comment-92545</guid>
		<description><![CDATA[[...] A member wondering how to handle null value in COBOL/400 is getting some help from TomLiotta, CharlieBrowne, and MDratwa. Jump in with your own expertise!  [...]]]></description>
		<content:encoded><![CDATA[<p>[...] A member wondering how to handle null value in COBOL/400 is getting some help from TomLiotta, CharlieBrowne, and MDratwa. Jump in with your own expertise!  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-92096</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Thu, 12 May 2011 22:40:17 +0000</pubDate>
		<guid isPermaLink="false">#comment-92096</guid>
		<description><![CDATA[&lt;i&gt;Flat files (unkeyed) can not contain nulls (null capable fields). You must use keyed PF or keyed LF:&lt;/i&gt;

Flat files do not equate with &#039;unkeyed&#039;. Unkeyed files are not necessarily &#039;flat files&#039; even though flat files will be unkeyed.

Further, null-capable columns can exist in unkeyed files. I have a number of them.

However, thanks for pointing out that this might not be a SQL issue. It hasn&#039;t actually been stated if the COBOL is using SQL or native I/O to process the file. The way that the term &quot;view&quot; was used in the question put me into thinking that SQL was the focus.

Your native I/O example could be the right direction.

Tom]]></description>
		<content:encoded><![CDATA[<p><i>Flat files (unkeyed) can not contain nulls (null capable fields). You must use keyed PF or keyed LF:</i></p>
<p>Flat files do not equate with &#8216;unkeyed&#8217;. Unkeyed files are not necessarily &#8216;flat files&#8217; even though flat files will be unkeyed.</p>
<p>Further, null-capable columns can exist in unkeyed files. I have a number of them.</p>
<p>However, thanks for pointing out that this might not be a SQL issue. It hasn&#8217;t actually been stated if the COBOL is using SQL or native I/O to process the file. The way that the term &#8220;view&#8221; was used in the question put me into thinking that SQL was the focus.</p>
<p>Your native I/O example could be the right direction.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mdratwa</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-92094</link>
		<dc:creator>mdratwa</dc:creator>
		<pubDate>Thu, 12 May 2011 20:52:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-92094</guid>
		<description><![CDATA[Flat files (unkeyed) can not contain nulls (null capable fields).  You must use keyed PF or keyed LF:  Null key map is used when any of the key fields are null capable.  Null map is used when any of the fields (key or not) are null capable.    In the null map or null key map fields will contain a B&#039;1&#039; or B&#039;0&#039; (&#039;0&#039; = not null, &#039;1&#039; = null).  Before any updating (write/rewrite), if you change a null to a value other than null, the corr null map field (and/or null key map) for that field needs to be changed from B&#039;1&#039; to B&#039;0&#039;.  The source must be changed from &quot;CBL&quot; to &quot;CBLLE&quot;.

SELECT IOF-GIS                             
       ASSIGN DATABASE-XXXLFA40W-ALWNULL   
       ORGANIZATION INDEXED                
       ACCESS DYNAMIC                      
       RECORD KEY EXTERNALLY-DESCRIBED-KEY 
       WITH DUPLICATES                     
       FILE STATUS WS-FILE-STATUS.
Working Storage Section.
01  WS-NULL-FILE-AREA.                
    COPY DDS-ALL-FORMATS OF XXXLFA40W 
        WITH NULL-MAP                 
        WITH NULL-KEY-MAP.            
Procedure Division.
READ IOF-GIS                      
    NULL-KEY-MAP IS SOMPFA40W-NKM 
    NULL-MAP IS SOMPFA40W-NM      
    INVALID KEY  (or next record)                 
         go to xxxx
END-READ.]]></description>
		<content:encoded><![CDATA[<p>Flat files (unkeyed) can not contain nulls (null capable fields).  You must use keyed PF or keyed LF:  Null key map is used when any of the key fields are null capable.  Null map is used when any of the fields (key or not) are null capable.    In the null map or null key map fields will contain a B&#8217;1&#8242; or B&#8217;0&#8242; (&#8217;0&#8242; = not null, &#8217;1&#8242; = null).  Before any updating (write/rewrite), if you change a null to a value other than null, the corr null map field (and/or null key map) for that field needs to be changed from B&#8217;1&#8242; to B&#8217;0&#8242;.  The source must be changed from &#8220;CBL&#8221; to &#8220;CBLLE&#8221;.</p>
<p>SELECT IOF-GIS<br />
       ASSIGN DATABASE-XXXLFA40W-ALWNULL<br />
       ORGANIZATION INDEXED<br />
       ACCESS DYNAMIC<br />
       RECORD KEY EXTERNALLY-DESCRIBED-KEY<br />
       WITH DUPLICATES<br />
       FILE STATUS WS-FILE-STATUS.<br />
Working Storage Section.<br />
01  WS-NULL-FILE-AREA.<br />
    COPY DDS-ALL-FORMATS OF XXXLFA40W<br />
        WITH NULL-MAP<br />
        WITH NULL-KEY-MAP.<br />
Procedure Division.<br />
READ IOF-GIS<br />
    NULL-KEY-MAP IS SOMPFA40W-NKM<br />
    NULL-MAP IS SOMPFA40W-NM<br />
    INVALID KEY  (or next record)<br />
         go to xxxx<br />
END-READ.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-92054</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Wed, 11 May 2011 22:02:37 +0000</pubDate>
		<guid isPermaLink="false">#comment-92054</guid>
		<description><![CDATA[If your tables have null-capable columns and any of those columns have null values, your program &lt;b&gt;must&lt;/b&gt; use null-indicators in order to fetch those rows successfully.

Tom]]></description>
		<content:encoded><![CDATA[<p>If your tables have null-capable columns and any of those columns have null values, your program <b>must</b> use null-indicators in order to fetch those rows successfully.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rr22</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-92035</link>
		<dc:creator>rr22</dc:creator>
		<pubDate>Wed, 11 May 2011 11:17:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-92035</guid>
		<description><![CDATA[Thanks for the reply.It is in COBOL/400.I am not using the null values in our program.It is present in View.When i am reading the view,it is reading same record due to Null value &amp; giving 46 error code.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the reply.It is in COBOL/400.I am not using the null values in our program.It is present in View.When i am reading the view,it is reading same record due to Null value &amp; giving 46 error code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-91953</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Mon, 09 May 2011 21:11:16 +0000</pubDate>
		<guid isPermaLink="false">#comment-91953</guid>
		<description><![CDATA[The SQL Programming with Host Languages manual has examples for COBOL coding. As with RPG, null columns will supply a &quot;null indicator&quot; that you need to test before using a variable that has a null value. An example might be like the following.

Given the statement:&lt;pre&gt;
EXEC SQL FETCH CLS_CURSOR INTO :CLS-CD,
                               :NUMDAY :NUMDAY-IND,
                               :BGN :BGN-IND,
                               :ENDCLS :ENDCLS-IND
END-EXEC.&lt;/pre&gt;
The variables can be declared as follows:&lt;pre&gt;
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
77 CLS-CD     PIC X(7).
77 NUMDAY     PIC S9(4) BINARY.
77 BGN        PIC X(8).
77 ENDCLS     PIC X(8).
77 NUMDAY-IND PIC S9(4) BINARY.
77 BGN-IND    PIC S9(4) BINARY.
77 ENDCLS-IND PIC S9(4) BINARY.
EXEC SQL END DECLARE SECTION END-EXEC.&lt;/pre&gt;
Is that what you&#039;re looking for?

Tom]]></description>
		<content:encoded><![CDATA[<p>The SQL Programming with Host Languages manual has examples for COBOL coding. As with RPG, null columns will supply a &#8220;null indicator&#8221; that you need to test before using a variable that has a null value. An example might be like the following.</p>
<p>Given the statement:
<pre>
EXEC SQL FETCH CLS_CURSOR INTO :CLS-CD,
                               :NUMDAY :NUMDAY-IND,
                               :BGN :BGN-IND,
                               :ENDCLS :ENDCLS-IND
END-EXEC.</pre>
<p>The variables can be declared as follows:
<pre>
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
77 CLS-CD     PIC X(7).
77 NUMDAY     PIC S9(4) BINARY.
77 BGN        PIC X(8).
77 ENDCLS     PIC X(8).
77 NUMDAY-IND PIC S9(4) BINARY.
77 BGN-IND    PIC S9(4) BINARY.
77 ENDCLS-IND PIC S9(4) BINARY.
EXEC SQL END DECLARE SECTION END-EXEC.</pre>
<p>Is that what you&#8217;re looking for?</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-91951</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Mon, 09 May 2011 20:05:29 +0000</pubDate>
		<guid isPermaLink="false">#comment-91951</guid>
		<description><![CDATA[Also, can you clarify if this is COBOL/400 (OPM) or ILE COBOL? The program code might be the same, but the compiled behaviors may be slightly different.

Tom]]></description>
		<content:encoded><![CDATA[<p>Also, can you clarify if this is COBOL/400 (OPM) or ILE COBOL? The program code might be the same, but the compiled behaviors may be slightly different.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: charliebrowne</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-handel-null-value-in-cobol400/#comment-91946</link>
		<dc:creator>charliebrowne</dc:creator>
		<pubDate>Mon, 09 May 2011 18:32:55 +0000</pubDate>
		<guid isPermaLink="false">#comment-91946</guid>
		<description><![CDATA[Can you post the code.
If you are just doing a read, it should not make any difference if a value is null.
If you are reading an LF and updating, then there is more of a possibility to keep on reading the same record.]]></description>
		<content:encoded><![CDATA[<p>Can you post the code.<br />
If you are just doing a read, it should not make any difference if a value is null.<br />
If you are reading an LF and updating, then there is more of a possibility to keep on reading the same record.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.043 seconds using memcached
Object Caching 365/371 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-21 17:30:00 -->