× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I figured out the problem...in this code sample in the HANDLETRANS procedure
I do a "clear trans". The other program I have that is similar to this one
handles credit cards and has a HANDLECARD procedure...which has a field
called cards (which is similar to trans in this example). I was not doing a
"clear cards" in that procedure. I inserted that line in and all seems to
function as I want. But, I guess this brings up another question, why/how
did this happen? How does data retrieved from one program get to another?


-----Original Message-----
From: Armbruster, Tom [mailto:Tom.Armbruster@xxxxxxxxxxxxxxx]
Sent: Monday, May 12, 2008 2:49 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: XML-INTO %Handler

Which fields contain the "extra" data? Is there any consistency?

Tom Armbruster

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Karissa Skroch
Sent: Monday, May 12, 2008 7:12 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: XML-INTO %Handler

Here is my code for the second program I call...I didn't post the entire
program, but the part dealing with the XML-INTO and the %Handler.

D TranDs DS Qualified
D REQUEST_TYPE 50A DIM(50)
D MERCHANT_ACCOUNT_ID...
D 10A DIM(50)
D ORDER_NUMBER 8A DIM(50)
D TRANSACTION_ID 20A DIM(50)
D TRANSACTION_KEY...
D 9A DIM(50)
D CARD_ID 9A DIM(50)
D NON_REFERENCED_CREDIT...
D 1A DIM(50)
D AMOUNT 9A DIM(50)
D SHIP_ADDRESS_STREET_1...
D 30A DIM(50)
D SHIP_ADDRESS_STREET_2...
D 30A DIM(50)
D SHIP_CITY 20A DIM(50)
D SHIP_STATE 2A DIM(50)
D SHIP_ZIP 10A DIM(50)
D SHIP_COUNTRY 2A DIM(50)
D COMMENTS 200A DIM(50)
D RESPONSE_TYPE 50A DIM(50)
D STATUS_CODE 5A
D STATUS_DESCRIPTION...
D 100A
D TRANSACTION_STATUS_CODE...
D 5A DIM(50)
D TRANSACTION_STATUS_DESC...
D 100A DIM(50)
D TRANSACTION_TYPE...
D 20A DIM(50)
D TRANSACTION_DATE...
D 10A DIM(50)
D CARD_TYPE 20A DIM(50)
D AUTH_CODE 6A DIM(50)
D ORIG_TRANSACTION_ID...
D 20A DIM(50)
D CARD_HOLDER_NAME...
D 30A DIM(50)
D CARD_NUMBER 16A DIM(50)
D CARD_EXPIRY 7A DIM(50)
D BILL_ADDRESS_STREET_1...
D 30A DIM(50)
D BILL_ZIP 10A DIM(50)
D BILL_COUNTRY 2A DIM(50)
D HL_CUSTOMER_NUMBER...
D 8A DIM(50)


D TRANSACTION DS QUALIFIED
D RESPONSE_TYPE 50A
D TRANSACTION_STATUS_CODE...
D 5A
D TRANSACTION_STATUS_DESC...
D 100A
D TRANSACTION_KEY...
D 9A
D TRANSACTION_ID 20A
D MERCHANT_ACCOUNT_ID...
D 10A
D TRANSACTION_TYPE...
D 20A
D TRANSACTION_DATE...
D 10A
D CARD_TYPE 20A
D AMOUNT 9A
D ORDER_NUMBER 8A
D AUTH_CODE 6A
D ORIG_TRANSACTION_ID...
D 20A
D CARD_HOLDER_NAME...
D 30A
D CARD_NUMBER 16A
D CARD_EXPIRY 7A
D BILL_ADDRESS_STREET_1...
D 30A
D BILL_ZIP 10A
D BILL_COUNTRY 2A
D COMMENTS 200A
D HL_CUSTOMER_NUMBER...
D 8A

D CCRTRNRQST PI
D PRMTRNINFO LIKEDS(TRANDS)

D HandleTrans PR 10I 0
D CommArea 10I 0
D Trans LikeDS(TRANSACTION)
D Dim(50) Const
D numElements 10I 0 Value


processRequestRet = processRequest( CCFacadeObj :
ProcReq );

XML-INTO %Handler (HandleTrans:count)
%XML (processRequestRet : 'path=CREDIT_CARD_RESPONSE/+
TRANSACTION_RESPONSE/TRANSACTION_LIST/+
TRANSACTION case=any allowmissing=yes');
Return;
Begsr *INZSR;
//Set the Classpath
Callp GUCCLSPTH();
//Construct object
CCFacadeObj = CCFacadeCon;
ENDSR;
/END-FREE

P HandleTrans B
D PI 10I 0
D count 10I 0
D Trans LikeDs(TRANSACTION)
D DIM(50) Const
D numElements 10I 0 Value

D i S 10I 0

/FREE
//Process through each CREDIT_CARD element and fill in the
PrmCardInfo array
for i = 1 to numElements;

prmtrninfo.transaction_key(i) = trans(i).transaction_key;
prmtrninfo.transaction_id(i) = trans(i).transaction_id;
prmtrninfo.merchant_account_id(i) =
trans(i).merchant_account_id;
prmtrninfo.transaction_type(i) = trans(i).transaction_type;
prmtrninfo.card_type(i) = trans(i).card_type;
prmtrninfo.transaction_date(i) = trans(i).transaction_date;
prmtrninfo.transaction_status_code(i) =

trans(i).transaction_status_code;
prmtrninfo.transaction_status_desc(i) =

trans(i).transaction_status_desc;
prmtrninfo.amount(i) = trans(i).amount;
prmtrninfo.order_number(i) = trans(i).order_number;
prmtrninfo.auth_code(i) = trans(i).auth_code;
prmtrninfo.orig_transaction_id(i) =
trans(i).orig_transaction_id;
prmtrninfo.card_holder_name(i) = trans(i).card_holder_name;
prmtrninfo.card_number(i) = trans(i).card_number;
prmtrninfo.card_expiry(i) = trans(i).card_expiry;
prmtrninfo.bill_address_street_1(i) =
trans(i).bill_address_street_1;
prmtrninfo.bill_zip(i) = trans(i).bill_zip;
prmtrninfo.bill_country(i) = trans(i).bill_country;
prmtrninfo.comments(i) = trans(i).comments;
prmtrninfo.hl_customer_number(i) =
trans(i).hl_customer_number;


ENDFOR;
clear trans;
return 0;

/END-FREE
P HANDLETRANS E

-----Original Message-----
From: Aaron Bartell [mailto:aaronbartell@xxxxxxxxx]
Sent: Friday, May 09, 2008 4:04 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: XML-INTO %Handler

Would you be able to post your code? That would give me a better handle
on what exactly is going on.

Thanks,
Aaron Bartell
http://mowyourlawn.com

On Fri, 2008-05-09 at 15:46 -0500, Karissa Skroch wrote:
Each program uses a different data structure. But yes, the data
structure
is cleared each time the program is called. The 'extra' data does not
appear until the %Handler procedure is called.

-----Original Message-----
From: Aaron Bartell [mailto:aaronbartell@xxxxxxxxx]
Sent: Friday, May 09, 2008 3:15 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: XML-INTO %Handler

Are you clearing the data structure before the second call?

Aaron Bartell
http://mowyourlawn.com








As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.