|
Do you have these statements in your program? process apost, nomonoprc. special-names. linkage type procedure for 'inet_addr'. I couldn't find a reference to this routine in the InfoCenter for the iSeries (what else is new....), so I'm not sure about your return parameter. I normally use: 01 return-code pic s9(09) binary. Good Luck, Terry > -----Original Message----- > From: Jay Sulzmann [mailto:jsulzmann@HBS-INC.COM] > Sent: Friday, May 24, 2002 8:37 AM > To: cobol400-l@midrange.com > Subject: IP Address Conversion using an IBM API > > > This is a multi-part message in MIME format. > -- > [ Picked text/plain from multipart/alternative ] > > I am trying to use IBM's API, "inet_addr" to convert an IP > address. The code I'm using is, > > 0161.00 CALL PROCEDURE "inet_addr" > 0162.00 USING > 0163.00 by value address of PmIpAddr > 0164.00 GIVING > 0165.00 ApiReturn > 0166.00 END-CALL. > > ApiReturn is pic s9(9) binary. We know that the IP Address > is valid. The call populates the variable by > -989614556. This is an error. > > The answer we're supposed to be getting is 3326352740. An > RPG test program gives us that. In RPG, we define the > ApiReturn value as "10U 0" (unsigned binary - no decimal places). > > I tried changing ApiReturn to pic 9(9) binary. It still ends > up with -989614556. > > (1) Does anyone have actual experience doing this? If so, > do I need to be doing something different or in addition to > what I'm already doing? > (2) If my pic clause is not correct, what is the correct pic > clause for "unsigned binary"? > (3) Any other suggestions? > > TIA > > Jay Sulzmann > Senior Programmer/Analyst > IBM Certified AS/400 RPG-IV Developer > > Hainey Business Systems > 8 E. Canal St > Dover, PA 17315 > Phone: (800) 932-3380 x231 Fax: (717) 292-9474 > Web: http://www.hbs-inc.com > ________________________________ > Providing E-Commerce, EDI, AS/400 > Development and related services > nationwide. > ================================ > > -- > > > _______________________________________________ > This is the COBOL Programming on the iSeries/AS400 > (COBOL400-L) mailing list > To post a message email: COBOL400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/cobol400-l > or email: COBOL400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/cobol400-l. >
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.