|
Basically build your message to send in a variable length field and xlate it ASCII. Then set your output buffer to Start_Block + ASCII_DATA + Cariage_Ret + Line_Feed. Your Write to the socket should be the length of the variable length field + 3. This way the SB/CR/LF do not get translated. You may want to double check the hex value of your line feed. I don't think x'25' is the ASCII value. Chris Bipes -----Original Message----- From: Gerald P. Kern [mailto:gkern@xxxxxxxxxxxxxxxxxxx] Sent: Monday, December 08, 2003 4:08 PM To: midrange-l@xxxxxxxxxxxx Subject: Socket Programming - HL7 Data to Win2k server Using the Scott Klement tutorial and the 'Sorcerer RPG' Redbook, I've learned to do iSeries to iSeries socket programming. In my proof of concept and coding, the programs communicated between the iSeries without problems, and that is because I controlled the data and the end of file processing. Now my challenge is to get my RPGIV client program talking to a Win2k server that's using Biztalk and Microsoft Message Queuing. My client program sends HL7 messages (from an EBCDIC DB2 file) that gets translated to ASCII (the translation works fine and is not the problem), as the variable length socket data field. So far my program connects to the server and sends the data, but after I send the data I'm not getting any reply from the server. My program hangs there, waiting for a response from the server (as it's supposed to do). We think it's because I'm not sending 'start block' and 'carriage return/line feed' data with my message - which is something the server is expecting. So at the request of the vendor, I modified the message I'm sending to send a 'start block' at the beginning of my HL7 message, and then a Carriage Return and Line Feed at the end of the HL7 message. So for the carriage return and line feed I'm sending the following hex equivalents: D Carriage_Ret C CONST(x'0D') D Line_Feed C CONST(x'25') And for the start block this: D Start_Block C CONST(x'0B') Is this correct for the 'start block'? Could this be a new line character or something similar? The vendor does see some kind of activity but I'm not sure what to send for the 'Start Block' and hex 0B was her recommendation, but she's not sure since she's not familiar with DB2, RPG or EBCDIC.
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.