|
This code comes from the DQ example in the pub but shows what you need to do. The interesting stuff is the last three lines. ProgramProgram returns you a byte array. You stuff that byte array into a Record object via the RecordFormat object. Then you pull individual data items out of the Record object. BinaryFieldDescription customerNumber = new BinaryFieldDescription(new AS400Bin4(), "CUSTOMER_NUMBER"); BinaryFieldDescription partNumber = new BinaryFieldDescription(new AS400Bin4(), "PART_NUMBER"); CharacterFieldDescription partName = new CharacterFieldDescription(new AS400Text(20, as400), "PART_NAME"); // etc. RecordFormat dataFormat = new RecordFormat(); dataFormat.addFieldDescription(customerNumber); dataFormat.addFieldDescription(partNumber); dataFormat.addFieldDescription(partName); // etc. byte[] returnedData = DataQueueData.getData(); Record data = dataFormat.getNewRecord(returnedData); Integer amountOrdered = (Integer) data.getField("QUANTITY"); String partOrdered = (String) data.getField("PART_NAME"); David Wall AS/400 Toolbox for Java OKogan@capitalfac tors.com To: java400-l@midrange.com Sent by: cc: java400-l-admin@m Subject: RE: Java to RPG question idrange.com 02/19/2002 02:16 PM Please respond to java400-l Dave, I have only one question left. I created ProgramParameter with a length of entire DS(Output only). Call RPG. Converted parameter to byte array. Now, how do I convert this array back to the RecordFormat??? Thank's for your help. Oleg. -----Original Message----- From: Dave Wall [mailto:dawall@us.ibm.com] Sent: Monday, February 18, 2002 1:56 PM To: java400-l@midrange.com Subject: RE: Java to RPG question Second, you could use a Toolbox RecordFormat object. That object is a collection of converters. You stick the proper types in the record format, then tell the object to dump out a byte array that your code sends to the server. An example is at http://publib.boulder.ibm.com/pubs/html/as400/v5r1/ic2924/info/rzahh/javadoc/DQProducerExample.html . The information transmitted by the following E-Mail is intended only for the addressee and may contain confidential and/or privileged material. Any interception, review, retransmission, dissemination, or other use, or taking any action upon this information by persons or entities other than the intended recipient is prohibited by law and may subject them to criminal or civil liability. If you received this communication in error, please contact us immediately at 954-730-2900 ext. 3600 and delete the communication from any computer or network system. _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-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.