|
Dean,
I 'think' that the list parameter will GENERATE such an item.
Dcl Var(&ListParm) Type(*Char) Len(162)
Dcl Var(&NbrEnt) Type(*UInt) Len(2) +
Stg(*Defined) DefVar(&ListParm 1)
Dcl Var(&UserLst) Type(*Char) Len(160) +
Stg(*Defined) DefVar(&ListParm 3)
I don't think it will CONSUME such an item.
IOW, if you front end your program with a command that has a list
parameter you may need the logic of the data structure above to process
that parameter. But methinks you cannot pass such a parameter to the
command.
This program blows up
&LISTPARM *CHAR 162 ' A123456789 B234567890
C' 0004C1F1F2F3F4F5F6F7F8F940C2F2F3F4F5F6F7F8F9F040
+26 '1 D23 '
F140C4F2F340404040404040404040404040404040404040
&NBRENT *UINT 2 4 0004
&USERLIST *CHAR 160 'A123456789 B234567890
C1 ' C1F1F2F3F4F5F6F7F8F940C2F2F3F4F5F6F7F8F9F040C3F1
+26 'D23 '
C4F2F3404040404040404040404040404040404040404040
DCL &ListParm *char 162
DCL &NbrEnt *uint 2 stg(*defined) DefVar(&ListParm 1)
DCL &UserList *char 160 stg(*defined) DefVar(&ListParm 3)
chgvar &UserList 'A123456789 B234567890 C1 D23'
?GRTOBJAUT OBJ(A) OBJTYPE(*FILE) USER(&UserList) /* Fails */
chgvar &NbrEnt 4
?GRTOBJAUT OBJ(A) OBJTYPE(*FILE) USER(&ListParm) /* Also fails */
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From: Dean Eshleman <Dean.Eshleman@xxxxxxxxxxxx>
To: Midrange-L Mailing list xxxx <midrange-l@xxxxxxxxxxxx>
Date: 02/05/2015 12:46 PM
Subject: Re: WEIRDNESS in list parameter in CL program:
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
James,
The reason your approach won't work is because a list parameter as the
number of entries in the list as a 2 byte integer at the beginning of the
variable. So, for your situation you could try something like this:
Dcl Var(&ListParm) Type(*Char) Len(162)
Dcl Var(&NbrEnt) Type(*UInt) Len(2) +
Stg(*Defined) DefVar(&ListParm 1)
Dcl Var(&UserLst) Type(*Char) Len(160) +
Stg(*Defined) DefVar(&ListParm 3)
I know I've done something like this in the past, but I can't find my
exact example right now. I pulled this definition from an article by
Bruce Vining on www.mcpressonline.com.
Dean Eshleman
Software Development Architect
Everence Financial
1110 North Main Street
PO Box 483
Goshen, IN 46527
Phone: (574) 533-9515 x3528
www.everence.com<http://www.everence.com/>
On 2015-02-04 7:23 PM, James H. H. Lampert wrote:> I have a CL program
that calls GRTOBJAUT, passing a variable in the
USER parameter.
If I format the variable I'm passing as CHAR(175) passing up to 16 user
profiles, space-delimited (the way I would enter it on a command line,
e.g., "FOO BAR BAZ ABCDEFGHIJ CORGE"), then it rejects it, taking "FOO
BAR BA" as a single list entry.
If I format the variable I'm passing as CHAR(160) passing up to 16 user
profiles aligned on 10-byte boundaries, it STILL rejects it.
What does it want?!?
HELLLLLPPPPPP MEEEEEEEEEEEE!
--
JHHL
______________________________________________________________________
Confidentiality Notice: This information is intended only for the
individual or entity named. If you are not the intended recipient, do not
use or disclose this information. If you received this e-mail in error,
please delete or otherwise destroy it and contact us at (800) 348-7468 so
we can take steps to avoid such transmission errors in the future. Thank
you.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.