 




<?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: Retreiving host name</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/retreiving-host-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/retreiving-host-name/</link>
	<description></description>
	<lastBuildDate>Sun, 26 May 2013 01:40:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: tomliotta</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retreiving-host-name/#comment-84444</link>
		<dc:creator>tomliotta</dc:creator>
		<pubDate>Sat, 27 Nov 2010 05:16:11 +0000</pubDate>
		<guid isPermaLink="false">#comment-84444</guid>
		<description><![CDATA[&lt;i&gt;The problem calling this from a CL program is that CL can not pass an “int” parameter until V5R3.&lt;/i&gt;

CL has been able to pass &quot;int&quot; parameters almost from the beginning. It just couldn&#039;t pass &quot;*INT&quot; parameters. There&#039;s a difference.

To study the difference, use this to define the &amp;SIZE variable:&lt;pre&gt;
 DCL        VAR(&amp;SIZE) TYPE(*CHAR) LEN(4) VALUE(X&#039;00000020&#039;)&lt;/pre&gt;
A 4-byte *CHAR variable can be assigned hexadecimal values. A 4-byte *INT variable holds x&#039;00000020&#039; when the integer value is (32), so that&#039;s the hex value to assign.

To handle numeric value changes in *CHAR variables, use the %BIN() built-in function.

Tom]]></description>
		<content:encoded><![CDATA[<p><i>The problem calling this from a CL program is that CL can not pass an “int” parameter until V5R3.</i></p>
<p>CL has been able to pass &#8220;int&#8221; parameters almost from the beginning. It just couldn&#8217;t pass &#8220;*INT&#8221; parameters. There&#8217;s a difference.</p>
<p>To study the difference, use this to define the &amp;SIZE variable:
<pre>
 DCL        VAR(&amp;SIZE) TYPE(*CHAR) LEN(4) VALUE(X'00000020')</pre>
<p>A 4-byte *CHAR variable can be assigned hexadecimal values. A 4-byte *INT variable holds x&#8217;00000020&#8242; when the integer value is (32), so that&#8217;s the hex value to assign.</p>
<p>To handle numeric value changes in *CHAR variables, use the %BIN() built-in function.</p>
<p>Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ayahel1</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retreiving-host-name/#comment-40068</link>
		<dc:creator>ayahel1</dc:creator>
		<pubDate>Thu, 20 Jul 2006 09:40:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-40068</guid>
		<description><![CDATA[If you need the TCP/IP host name you can try to use the C function gethostname(name, size).
The problem calling this from a CL program is that CL can not pass an &quot;int&quot; parameter until V5R3.
With V5R3 and above, you can. Try this:
PGM
DCL        VAR(&amp;NAME) TYPE(*CHAR) LEN(33)                 
DCL        VAR(&amp;SIZE) TYPE(*INT) LEN(4) VALUE(32)

CALLPRC    PRC(&#039;gethostname&#039;) PARM((&amp;NAME) (&amp;SIZE *BYVAL))

SNDPGMMSG  MSG(&#039;Host name = &#039; &#124;&#124; &amp;NAME)
ENDPGM]]></description>
		<content:encoded><![CDATA[<p>If you need the TCP/IP host name you can try to use the C function gethostname(name, size).<br />
The problem calling this from a CL program is that CL can not pass an &#8220;int&#8221; parameter until V5R3.<br />
With V5R3 and above, you can. Try this:<br />
PGM<br />
DCL        VAR(&amp;NAME) TYPE(*CHAR) LEN(33)<br />
DCL        VAR(&amp;SIZE) TYPE(*INT) LEN(4) VALUE(32)</p>
<p>CALLPRC    PRC(&#8216;gethostname&#8217;) PARM((&amp;NAME) (&amp;SIZE *BYVAL))</p>
<p>SNDPGMMSG  MSG(&#8216;Host name = &#8216; || &amp;NAME)<br />
ENDPGM</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ayahel1</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retreiving-host-name/#comment-40069</link>
		<dc:creator>ayahel1</dc:creator>
		<pubDate>Thu, 20 Jul 2006 09:33:49 +0000</pubDate>
		<guid isPermaLink="false">#comment-40069</guid>
		<description><![CDATA[If you need the TCP/IP host name you can try to use the C function gethostname(name, size).
The problem calling this from a CL program is that CL can not pass an &quot;int&quot; parameter until V5R3.
With V5R3 and above, you can. Try this:
PGM
DCL        VAR(&amp;NAME) TYPE(*CHAR) LEN(33)                 
DCL        VAR(&amp;SIZE) TYPE(*INT) LEN(4) VALUE(32)

CALLPRC    PRC(&#039;gethostname&#039;) PARM((&amp;NAME) (&amp;SIZE *BYVAL))

SNDPGMMSG  MSG(&#039;Host name = &#039; &#124;&#124; &amp;NAME)
ENDPGM                                                    
]]></description>
		<content:encoded><![CDATA[<p>If you need the TCP/IP host name you can try to use the C function gethostname(name, size).<br />
The problem calling this from a CL program is that CL can not pass an &#8220;int&#8221; parameter until V5R3.<br />
With V5R3 and above, you can. Try this:<br />
PGM<br />
DCL        VAR(&amp;NAME) TYPE(*CHAR) LEN(33)<br />
DCL        VAR(&amp;SIZE) TYPE(*INT) LEN(4) VALUE(32)</p>
<p>CALLPRC    PRC(&#8216;gethostname&#8217;) PARM((&amp;NAME) (&amp;SIZE *BYVAL))</p>
<p>SNDPGMMSG  MSG(&#8216;Host name = &#8216; || &amp;NAME)<br />
ENDPGM                                                    </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vatchy</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/retreiving-host-name/#comment-40070</link>
		<dc:creator>vatchy</dc:creator>
		<pubDate>Thu, 20 Jul 2006 07:56:51 +0000</pubDate>
		<guid isPermaLink="false">#comment-40070</guid>
		<description><![CDATA[Alternatively, you could retrieve the system value QSRLNBR to get the system&#039;s serial number.  On two systems, the system names could possibly be the same but the serial numbers should be unique.]]></description>
		<content:encoded><![CDATA[<p>Alternatively, you could retrieve the system value QSRLNBR to get the system&#8217;s serial number.  On two systems, the system names could possibly be the same but the serial numbers should be unique.</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.090 seconds using memcached
Object Caching 309/315 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-26 02:49:31 -->