Yes...you can do it that way...or, you could take the contents of the
file and put it into an array or data structure. HAve a basing pointer
that points to the data structure, like this:

D MyArr     S        80    Dim(100)
D MyPtr     S           *  Based(MyArr)

So now MyPtr is a pointer that points to the MyArr array. When you do
your call to MQPUT, reference MyPtr like this:

C                   CallP     MQPut(HConn   :
C                                   HOutObj :
C                                   MQMd    :
C                                   MQPmo   :
C                                   BufLen  :
C                                   MyPtr   :
C                                   CCode   :
C                                   Reason)  

Ad do it in RPG/IV, not RPG/400.

On Mon, 22 Mar 2004 14:23:25 -0500, "Carl Galgano"
<cgalgano2@xxxxxxxxxxxxxxxxx> said:
> OK, you smart guys are confusing me.  Passing parms by value, reference
> etc,
> are things I learned way back in the early 80s in college.  Granted, my
> coding is a little rusty.  I don't code very often anymore.
> Tell me if this is doable.  I am doing this in RPG/400 (non ILE, but I
> guess
> I could do it in ILE if I need to).  I don't remember much about
> pointers.
> 
> I want to read the contents of a file (lets say 100 80 byte records), and
> store in a user space.  After I initially use the QUSCRTUS API to create
> the
> user space, I assume I will use the QUSCHGUS API to add my data to the
> user
> space, changing the beginning offset by 80 each time and keeping track of
> how many 80 byte records I have written to the user space (to calculate
> the
> buffer length).
> 
> Once my entire file is in the user space, I then will user the Retrieve
> User
> Space API to retrieve it and then call the MQ API (QMQM) to do the MQPUT.
> Does this sound right?
> cjg
> 
> Carl J. Galgano
> EDI Consulting Services, Inc.
> 600 Kennesaw Avenue, Suite 400
> Marietta, GA  30060
> (770) 422-2995 - voice
> (419) 730-8212 - fax
> mailto:cgalgano@xxxxxxxxxxxxxxxxx
> http://www.ediconsulting.com
> AS400 EDI, Networking, E-Commerce and Communications Consulting and
> Implementation 
> http://www.icecreamovernight.com
> Premium Ice Cream Brands shipped Overnight
> 
> Visit our website to subscribe to our FREE AS/400 Timesharing Service
> 
> -----Original Message-----
> From: Keith Carpenter [mailto:CarpCon@xxxxxxx] 
> Sent: Monday, March 22, 2004 1:45 PM
> To: Midrange Systems Technical Discussion
> Subject: Re: Record size limitation in RPG - MQ Series
> 
> 
> If you're talking external program calls then you're basically correct. 
> MI
> is the exception as it can pass/receive parms by value.
> 
> It sounds like MQ series uses an ILE procedure interface.   I would
> expect
> large parameters like a buffer to be passed as a pointer.  Not very
> efficient to pass a buffer by value.   The buffer parm is likely defined
> as
> either a "pointer by value" or a "varsize field by reference".   Actually
> both of these are the effectively the same (pointer to data).
> 
> 
> Keith
> 
> 
> ----- Original Message ----- 
> From: "jt" <jt@xxxxxx>
> To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
> Sent: Monday, March 22, 2004 8:35 AM
> Subject: RE: Record size limitation in RPG - MQ Series
> 
> 
> > If doing this in RPG, when RPG passes a parm it is actually passing a 
> > pointer TO the parm.  This is because RPG passes parms "by reference"
> rather
> > than "by value", normally.  (I don't recall, right now, if RPG even 
> > CAN
> pass
> > by value, but think that mebbe was added with CONST or some such.)  I
> dunno
> > MQ, however, but sounds like you just pass the variable-name and it'll
> work.
> >
> > | -----Original Message----- 
> > | [mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Carl Galgano
> > | Sent: Monday, March 22, 2004 10:58 AM
> >
> > | How do you pass the
> > | pointer to a user
> > | space to the MQPUT?  There is an API to call to do the MQPUT, but I
> don't
> > | know how to pass the pointer.
> >
> >
> > _______________________________________________
> > 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.
> 
> 
> 
> _______________________________________________
> 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.
> 
-- 
  
  michaelr_41@xxxxxxxxxxxxxx

-- 
http://www.fastmail.fm - Email service worth paying for. Try it for free

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