 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; RPG RPGLE RPGfree</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/rpg-rpgle-rpgfree/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 17:54:18 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Prototyping C in RPG</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/prototyping-c-in-rpg/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/prototyping-c-in-rpg/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 17:32:56 +0000</pubDate>
		<dc:creator>Jabamx6</dc:creator>
				<category><![CDATA[RPG RPGLE RPGfree]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hello; So the people above my head ask me work on this project, something I never work with/on, never did anything with C or much with pointers on AS400/RPG Trying to create RPG program to mimic C on AS400 to call API for tax software, so looking for any help that anyone might have: Here [...]]]></description>
				<content:encoded><![CDATA[<p>Hello;<br />
So the people above my head ask me work on this project, something I never work with/on, never did anything with C or much with pointers on AS400/RPG</p>
<p>Trying to create RPG program to mimic C on AS400 to call API for tax software, so looking for any help that anyone might have:</p>
<p>Here is the C prototype:</p>
<p><i>PREFIX tVstConnHdl POSTFIX VstCreateConnHdl (void);              <br />
                                                                 <br />
typedef tVstConnHdl (POSTFIX *tVstCreateConnHdl) (void);         <br />
                                                                 <br />
/* Establish a connection to a specified Quantum database. */    <br />
PREFIX tVstDbRetCd POSTFIX VstOpenDb (tVstConnHdl     pConnHdl,  <br />
                                      tVstDbType      pDbType,   <br />
                                      char           *pDataSource,<br />
                                      char           *pServerName,     <br />
                                      char           *pUserID,         <br />
                                      char           *pPwd,            <br />
                                      tVstAccessMode  pAccessMode,     <br />
                                      char           *pRetCode,        <br />
                                      char           *pRetCodeDetail);  </i></p>
<p>So now I&#8217;m trying to recreate this in RPG and call these 2 function to Create Handle and Open DB connection &#8211; but not understanding this too much</p>
<p>Here is what I got so far in RPG: (keep in mind that never done that and just put something to be able to compile it)<br />
<i>*******************************************************************************<br />
D NULL            C                    CONST(x&#8217;00&#8242;)                           <br />
                                                                              <br />
d lConHnd         s               *                                           <br />
D T1_ConnHnd      pr              *   extproc(*cwiden:&#8217;VstCreateConnHdl&#8217;)     <br />
                                                                              <br />
d T2_OpenDB       PR              *   extproc(*cwiden:&#8217;VstOpenDb&#8217;)             </p>
<p>d  ConnHnd                            like(lconhnd)                           <br />
d  DBtype                       20u 0                                         <br />
d  Data_src                       *   Value Options(*STRING)                  <br />
d  Server_name                    *   Value Options(*STRING)                  <br />
d  User_ID                        *   Value Options(*STRING)                  <br />
d  Password                       *   Value Options(*STRING)                  <br />
d  AccessMod                    20u 0                                         <br />
d  Ret_Code                       *   VALUE OPTIONS(*STRING)                  <br />
D  Ret_CodeDet                    *   value options(*String)        <br />
         <br />
d parm1           s             20u 0                <br />
d parm2           s             20u 0                <br />
d parm3           s               *                  <br />
d parm4           s               *                  <br />
d parm5           s               *                  <br />
d parm6           s               *                  <br />
d parm7           s             20u 0                <br />
d parm8           s               *                  <br />
d parm9           s               *                  <br />
                                                     <br />
d var3            s              6a   Inz(&#8216;VERERQ&#8217;)  <br />
d var4            s             10a   Inz(&#8216;I5SAP&#8217;)   <br />
d var5            s             10a   Inz(null)      <br />
d var6            s             10a   Inz(null)      <br />
d var8            s             10a   Inz(null)      <br />
d var9            s             10a   Inz(null)      <br />
                                                     <br />
 /free                                               <br />
     lconhnd = T1_ConnHnd();                         <br />
     parm3 = %addr(var3);  <br />
     parm4 = %addr(var4);  <br />
     parm5 = %addr(var5);  <br />
     parm6 = %addr(var6);  <br />
     parm8 = %addr(var8);  <br />
     parm9 = %addr(var9);  <br />
                           <br />
     T2_OpenDb(lconhnd:    <br />
               Parm2:      <br />
               parm3:      <br />
               parm4:      <br />
               parm5:      <br />
               parm6:      <br />
               Parm7:      <br />
               Parm8:      <br />
               parm9);     <br />
                           <br />
   *InLR = *On;            <br />
   Return;                 <br />
 /end-free  </i>                                                                              </p>
<p>no some of the parm&#8217;s (2 &#038; 7) I just made it unsigned long  just to make it work&#8230; anyways the first call to create the handle I guess is working since its not blowing up on it, its on the second one since I can&#8217;t figure out what to do or how to define parm 2 &#038; 7                                                                     </p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/prototyping-c-in-rpg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</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/9 queries in 0.014 seconds using memcached
Object Caching 312/313 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 21:40:14 -->