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



Michael,

I think you're flirting with disaster... Perhaps this works as you expect today, but this technique is really unsafe and unreliable.

When the command line parser takes apart your string, it will trim trailing blanks from the parameter values being parsed. If you can guarantee that your data structure will never have trailing blanks, then you're safe enough to do it this way. Otherwise, the command parser will reserve enough storage to contain the trimmed data. If this length is not the same as the parm length defined in your program, then you could get garbage at the end of your DS...

Chuck's HEX trick is really clever...

-Eric DeLong

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Koester, Michael
Sent: Thursday, May 24, 2012 4:41 PM
To: RPG programming on the IBM i / System i
Subject: RE: Passing data structure to batch job RESOLVED

Okay, Tommy Holden gets all the extra points!
My test program that submits the longer-running job just successfully passed the data-structure as a parm, intact, and without having to "hexify" anything. Debugging the submitted job showed all the subfields have the intended values, and all is cool.

// Where NMS_OrderDetails is the name of the data structure from the copybook
// and PROVSN_NMS is the program that will run from a different job queue because
// it takes awhile...

Command = 'SBMJOB CMD(CALL PGM(PROVSN_NMS) PARM('''
+ NMS_OrderDetails
+ ''')) JOB(TESTING) jobq(QBATCH4)';

CallP QCMDEXC(%trim(COMMAND) : %len(%trim(COMMAND)));

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

Thanks to all for the elegant (if perhaps more complicated than necessary) ideas.

-- Michael

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tommy.Holden@xxxxxxxxxxxxxxxxxxxxx
Sent: Thursday, May 24, 2012 5:01 PM
To: RPG programming on the IBM i / System i
Subject: RE: Passing data structure to batch job

Will the DS ever be larger than 5000 characters? If not then why not just create a command that accepts a single parm and use the command on the SBMJOB?



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.