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



Colin and everyone else that has added to this thread, thank you, thank you,
thank you!!!

I have accomplished what I need to do, and learned a little about using user
spaces and pointers in the process.
My final solution was to write 2 programs.  One is RPG/400 and the other is
ILE-RPG (a first for me, I don't code much anymore, especially application
stuff).

My old fashion RPG/400 program is very simple.  It reads in 80 byte records
from a wrapped EDI file, and uses the Change User Space API to write the
data to the user space, adding 80 to the offset in a DO loop.  This part was
very simple.

I had a few more challenges writing the ILE code, not because what I wanted
to do was complicated, but because I am such a rookie at this stuff.  I
found a decent sample ILE code for MQ in the QMQMSAMP library.  I modified
it to retrieve the pointer to the user space, and then pass it to the MQ
API.  I struggled for several hours with the data being offset by 124 bytes,
tried to do some pointer arithmetic, but in the end I was making the whole
exercise more complicated that it needed to be.  I was using some code
examples from the archives that showed how to retrieve the pointer to a user
space, however the example I was looking at was to read the data from a list
type API that contained header info (124 bytes) and repeating list info.  My
data started in position 1 of the user space.  All I had to do was get the
pointer to the user space (as Colin suggested below) and I was good to go.

Also, I want to thank Scott Klement for some sample code he posted on the
RPG list that also helped me quite a bit (from the archives).

As always, you guys are great and I can never contribute to the extend that
I take from this community.
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: Colin Williams [mailto:colin.williams@xxxxxxxxxxxx] 
Sent: Monday, March 22, 2004 5:51 PM
To: Midrange Systems Technical Discussion
Subject: Re: Record size limitation in RPG - MQ Series


Carl,

one way I have done this, is to create a 1A field in the D specs, based on a
pointer that you have also defined in your D specs

eg wsData  1A BASED(PTR1),

then somewhere in your code set PTR1 to the value of the pointer to the user
space.

put the 1A field as the parameter for the message on your MQPUT, still
setting your message length to the actual length of the data

cheers
Colin.W


----- Original Message -----
From: "Carl Galgano" <cgalgano2@xxxxxxxxxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx>
Sent: Monday, March 22, 2004 3:57 PM
Subject: RE: Record size limitation in RPG - MQ Series


> Eric, Keith, Colin, jt, James, Scott, et al.
> Thanks for all the great suggestions.  You guys are great.  I think I 
> am going to attempt to use a user space.  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.  Anyone have an example.  I am 
> going to do a little more research in the archives. 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: Colin Williams [mailto:colin.williams@xxxxxxxxxxxx]
> Sent: Saturday, March 20, 2004 3:47 PM
> To: Midrange Systems Technical Discussion
> Subject: Re: Record size limitation in RPG - MQ Series
>
>
> Carl
>
> user spaces are actually pretty easy to use.
>
> Use the API QUSPTRUS, Retrieve User Space Pointer, in your RPG, to 
> point a 32K variable in your RPG to a user space.  Then when you 
> update the variable, you will be writing to the user space.
>
> When you fill up the variable, add 32k to the pointer, clear the 
> variable and do it again until you've processed the whole message.
>
> Pass the message length and the pointer to the user space to MQPUT, 
> and
your
>
> away. Did the same thing 8 years ago, and im sure that was on V3R7
>
> cheers
> Colin.W
>
>
> ----- Original Message -----
> From: "Carl Galgano" <cgalgano2@xxxxxxxxxxxxxxxxx>
> To: "'Midrange Systems Technical Discussion'" 
> <midrange-l@xxxxxxxxxxxx>
> Sent: Saturday, March 20, 2004 3:41 PM
> Subject: RE: Record size limitation in RPG - MQ Series
>
>
>
>
> _______________________________________________
> 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 e-mail has been sent by a company of Bertram Group Ltd, whose
registered office is The Nest, Rosary Road Norwich NR1 1TF. 
This message, and any attachments, are intended solely for the addressee and
may contain privileged or confidential information.  If you are not the
intended recipient, any disclosure, copying, distribution or any action
taken or omitted to be taken in reliance on it, is prohibited and may be
unlawful.  If you believe that you have received this email in error, please
contact the sender immediately. Opinions, conclusions and statements of
intent in this e-mail are those of the sender and will not bind a Bertram
Group Ltd company unless confirmed in writing by a director independently of
this message. 
Although we have taken steps to ensure that this email and any attachments
are free from any virus, we advise that in keeping with good computing
practice the recipient should ensure they are actually virus free.

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