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


  • Subject: Re: parameter list list
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Thu, 5 Apr 2001 00:57:39 -0500 (CDT)



On Wed, 4 Apr 2001, Pantzopoulos, Mike wrote:

> I allow up to 50 object names (of 10 bytes each) to be passed in to the
> command, so I have a parameter declaration of -
> 
>  DCL        VAR(&OBJECT) TYPE(*CHAR) LEN(502) 
> 
> I thought I'd be clever and pass the list of object names to the SAVOBJ
> command by extracting bytes 3 to 22 from &OBJECT into &OBJLST and using that
> value as -
> 
> SAVOBJ     OBJ(&OBJLST) LIB(&FRMLIB) DEV(*SAVF) ...................     
> 
> This works when I have only one object in the parameter list, but when I
> have more than one parameter it doesn't.
> 

Mike,

    The CL command interpreter is expectng you to specify a seperate
variable for every object in your object list.   Its loading the entire
contents of the &OBJLIST variable all into the FIRST object name spot for
the OBJ() parameter.

Naturally, due to the fact that the object name has spaces in it, this
won't work.  (Unless, of course, you only supply one object)

What you want it to do is assemble the entire command as a STRING, then
parse out the different object values based on where you put the
spaces between the objects.

The easy way is to use the QCMDEXC API.   Something like this should
solve your problem:


DCL VAR(&CMD) TYPE(*CHAR) LEN(1000)
DCL VAR(&OBJLIST) TYPE(*CHAR) LEN(502)

/* BUILD A SAVOBJ COMMADN */

CHGVAR VAR(&CMD) VALUE('SAVOBJ OBJ(' *TCAT &OBJLIST *TCAT ') +
    LIB(' *TCAT &FROMLIB *TCAT ') DEV(*SAVF) ...etc...')

/* RUN THE SAVOBJ COMMAND */

CALL QCMDEXC PARM(&CMD 1000)


etc


Hope that helps!



+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.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.