× 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.



First off, thanks to all who contributed to this thread. Much more to think about than I had imagined.

From Eric's post last Thursday...
I think you're flirting with disaster... Perhaps this works as you expect today, but this technique is really unsafe and unreliable.

I took the advice to heart and added an "EndOfDS" marker field to the ds, with a single "x" character to prevent the inadvertent trimming of trailing blanks, and used Chuck's technique of changing the contents of the data structure to hex before passing. Thanks for the advice.

Barbara, I was curious to see how an embedded x'7d' would impact the result, so I stuffed one into a varying character subfield before passing the ds. Since I'm now converting the ds string to hex before passing it (per Chuck), it appears to have no impact on the integrity of the data structure received by the submitted job -- the single quote remains where I put it and does not disrupt the contents of any other subfield.

Chuck, I agree setting up a hard-coded length of the data structure is not optimal, but I'm at a loss as to how to avoid that. In my testing, I initially set NMS_DS at 256a, and saw trailing junk passed in the parm, but since the receiving program does not define that area of the incoming string, there is no impact. Just needs to be "big enough".

For those with insatiable curiosity, my test code is at:
http://code.midrange.com/a7cae8b945.html NMS_PROTOS copybook stuff
http://code.midrange.com/456fdb0163.html TESTSTUFF sqlrpgle passing ds
http://code.midrange.com/974ff57bb8.html TESTSTUFF2 sqlrpgle receiving ds

Thanks again to all!
-- Michael

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Monday, May 28, 2012 7:09 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Passing data structure to batch job RESOLVED

On 2012/5/24 5:40 PM, Koester, Michael wrote:
...

Who would have thought it would be that easy. (Not me, obviously)


Watch out for embedded quotes. You might not have any quotes in your character subfields, but if you have an integer subfield it could easily have x'7d' as part of the integer data. Same with the length prefix of a varying length field.

So you should run through your data structure and change any x'7d' to x'7d7d'. (You could use RPG's %scanrpl for this if you are on v7r1.)

But this mechanism of passing the data structure as though it were a character value seems icky to me. Even though there's more setup required, using a data queue, or data area (but brrr, not the *LDA), or a file, or a user space would be better in the long run, I think.
--


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.