RE: Service Programs & Copy Source
Greg Wilburn <gwilburn-kuYYJ3CQfvZxq3Q2jbZZw/[email protected]>
| Newsgroups | gmane.comp.lang.as400.rpg |
|---|---|
| Message-ID | <PH0PR17MB486328C26D14237CD235FC5FDAE9A@PH0PR17MB4863.namprd17.prod.outlook.com> |
Thanks for the input - those are great points... I have some of the constants in a table already (along with the credentials, tokens, etc.) But if the URL changes, it's likely the version changes, so I end up changing the service pgm anyway using UPDSRVPGM I'm more concerned with things like a procedure called getAccessToken(). I have that same proc name in several APIs. (YES, I should have created these with a prefix - I do that now, but didn't 10 years ago). I also have a lot of "template" fields and structures defined that are rather large. Keep in mind that these are for our internal use. -----Original Message----- From: RPG400-L <rpg400-l-bounces-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org> On Behalf Of Brad Stone Sent: Thursday, October 16, 2025 10:06 AM To: RPG programming on IBM i <[email protected]> Subject: Re: Service Programs & Copy Source I personally would add them the the existing /copy source, and make a new/additional signature in the service program with the binder language so old programs will use the old signature until recompiled. As for your constants, etc like endpoints, other values, I used to make them constants in source but remember if they change it will require a recompile of everything. So instead I make "control files" with a name and value and make a simple getControlValue() function that does a simple SQL on the control file to get the value... like this: endpoint = getControlValue('AMAZON_BASE_URL'); This way if anything changes it's a simple file update. I used to use data areas before that and that turned into a headache with so many contants that could change in the future for some functions with Google, Microsoft, UPS, etc. Greg Wilburn Director of IT 301.895.3792 ext. 1231 -- This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: [email protected] To subscribe, unsubscribe, or change list options, visit: https://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l. Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.