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



Vern,

Would access() work for system objects, user index in this case, or is it just for IFS objects?

Rick

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Vern Hamberg
Sent: Friday, October 22, 2010 6:04 PM
To: RPG programming on the IBM i / System i
Subject: Re: RSLVSP extended template definition help

Rick

I'm wondering why you are using an MI instruction - the access() function does the job very well for anything you can use a path name for. Put in the path, use a zero for test (passed by value) and if you get a zero back, the object exists. Something like that.

Of course, if you are just playing!! :-)

HTH
Vern

On 10/22/2010 3:51 PM, Rick.Chevalier@xxxxxxxxxxxxxxx wrote:
I am trying to use the RSLVSP MI instruction to check object existence from a procedure at run time. If the object exists everything is fine. If the object doesn't exist I get a MCH error. If I understand the documentation correctly I can set a value in the extended template under the options section to not return the MCH error and just return a null pointer instead.

When I try this I get MCH5601:
Message . . . . : Template value not valid for instruction.
Cause . . . . . : The location of the value is template with an offset to
field in bytes X'FFDC', an offset in field in bits X'0001', a length of
field of 128, and an instruction operand number of 2. The reason code is
X'0000'. If the reason code is X'0000', a reason code may not be available.

Running the value of x'FFDC' through a hex to decimal conversion I get 65,500 which is slightly larger than my field size of 128.

I have searched the RPG archives for an example of using the extended template but didn't see one. Here is what I have based on my understanding of the documentation.

d dsUsrIdxDesc ds Qualified
d TypeCode 1a Inz(x'0E')
d SubtypeCode 1a Inz(x'0A')
d ServicePgm 30a Inz('UT1025UI')
d ReqAuth 2a Inz(x'0001')
d TemplateVer 1a Inz(x'00')
d SearchMethod 1a Inz(x'00')
d Options 1a Inz(x'02')
d Reserved1 7a Inz(x'00')
d ASPToSearch 2a Inz(x'00')
d ASPOfContext 2a
d PtrToContext * ProcPtr
d Reserved2 64a Inz(x'00')

Any ideas what I'm missing?


Rick Chevalier




________________________________
Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.



Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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