|
Copied to MI400-L 'cause someone else might be interested and it's not an RPG problem evn though the code is in RPG ... Hello Bill, I can guarantee the problem is in the values you are passing to this program. I wrote it on VRM440 with Cume 0049440. From your comment about the object name, I guess you haven't done much MI. If you intend to do MI (even via RPG IV or C) you WILL need a copy of the MI Functional Reference Manual. You will also need the C-language MI Library Reference Manual if you intend to use the function interfaces. You wrote: >Cause . . . . . : The length of the invalid scalar operand is 34. The bit > offset to the invalid field is X'0000'. The operand number is 2. The > invalid data is > X'2000E2C4C2D6D6D2C3D6E24040404040404040404040404040404040404040400000'. What that message is telling you is that the second parameter has a problem. (Since setsppfp() takes a single operand we can discount it as the source of the problem -- that leaves rslvsp() which takes four parameters). Note that the problem is really with the second operand of the rslvsp MI instruction rather than the rslvsp() function. The statement information in the Additional details part of the message should tell you more information about the statement with the problem. The bit offset to the invalid field is X'0000' which means the field starting at offset zero contains invalid data. If you check the MI reference you will see that the rsvlsp MI instruction expects operand 2 to be a structure having a 1-byte object type, a 1-byte subtype, a 30-byte name, and a 2-byte authorization. If you apply that layout to the invalid data above you get: Ty St Name Auth > 20 00 E2C4C2D6D6D2C3D6E2404040404040404040404040404040404040404040 >0000 Not only does MCH5003 tell you the problem is the first field but you can see the name and auth are in the correct place. The 'two byte offset' you mention is the type and subtype. Type x'20' subtype x'00' is a SOM object which is an invalid object type for the external version of rslvsp. I assume you are trying to resolve to a program object which is type x'02' subtype x'01' Fix the object type and the code should work. Regards, Simon Coulter. «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» «» FlyByNight Software AS/400 Technical Specialists «» «» Eclipse the competition - run your business on an IBM AS/400. «» «» «» «» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 «» «» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au «» «» «» «» Windoze should not be open at Warp speed. «» «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» //--- forwarded letter ------------------------------------------------------- > X-Mailer: Microsoft Outlook Express 5.00.2919.6600 > Date: Mon, 17 Jul 00 10:19:38 -0700 > From: "Bill" <bubbzbill@yahoo.com> > To: shc@flybynight.com.au > Subject: Re: Convert an MI program to RPG > > Hi Simon, > > Thanks for the program. Unfortunately, it doesn't work on my system. I'm > at V4R4, did something change? Here's what I am getting: > > Message ID . . . . . . : MCH5003 > Date sent . . . . . . : 07/17/00 Time sent . . . . . . : > 10:15:21 > > Message . . . . : Scalar operand contains a value that is not valid. > > Cause . . . . . : The length of the invalid scalar operand is 34. The > bit > offset to the invalid field is X'0000'. The operand number is 2. The > invalid data is > X'2000E2C4C2D6D6D2C3D6E24040404040404040404040404040404040404040400000'. > > As you can see, the object name is offset by 2 bytes. Any ideas? > > Bill > > ----- Original Message ----- > From: "Simon Coulter" <shc@flybynight.com.au> > To: <RPG400-L@midrange.com> > Sent: Sunday, July 02, 2000 2:26 AM > S ject: Re: Convert an MI program to RPG > > > > > > Hello Bill, > > > > You wrote: > > >Hi everyone. Would it be possible to change the following MI program to > use RPG/ILE > > >instead? > > > > Yes > > > > >It is a program that obtains a pointer to a supplied qualified object. > > > > No it's not. It is a program that returns a pointer to the associated > space of a > > supplied qualified object. > > > > >If this is more appropriate to the MI list, feel free to reply there as I > am a > > subscriber there as well. > > > > It's probably more appropriate for the C400 list which is how you should > be doing MI > > if you don't want to rub the bare metal -- RPG is not really the ideal > choice due to > > its limited pointer support). > > > > Here is some RPG that appears to satisfy your requirements. A very > cursory check > > indicates it points to the right stuff. There are other methods of > implementing this > > but the following code is similar to the C implementation. > > > > H DFTACTGRP(*NO) ACTGRP('QILE') BNDDIR('QC2LE') > > D RSLVSP PR * EXTPROC('rslvsp') > > D intObjType 4 VALUE > > D intObjName 31 > > D intLibName 31 > > D reqAuth 4 > > D SETSPPFP PR * EXTPROC('setsppfp') > > D objPtr * > > D TESTMI PR > > D libName 10 > > D objName 10 > > D objType 10 > > D spcPtr * > > D rtnCode 1 > > D TESTMI PI > > D libName 10 > > D objName 10 > > D objType 10 > > D spcPtr * > > D rtnCode 1 > > > > D $ERROR C CONST('1') > > D $OK C CONST('0') > > D $AUTH_NONE C CONST(X'00000000') > > D $NULL C CONST(X'00') > > > > D @obj S * > > > > D rslvObj_T DS > > D intObjType 4 > > D intObjName 31 > > D intLibName 31 > > D reqAuth 4 > > > > C EVAL rtnCode = $ERROR > > > > * Resolve to object > > C EVAL intObjType = objType > > C EVAL intObjName = %TRIM(objName) + $NULL > > C EVAL intLibName = %TRIM(libName) + $NULL > > C EVAL reqAuth = $AUTH_NONE > > C EVAL @obj = RSLVSP( intObjType : > > C intObjName : > > C intLibName : > > C reqAuth ) > > > > * Address the associated space > > C EVAL spcPtr = SETSPPFP( @obj ) > > > > > > C EVAL rtnCode = $OK > > > > C SETON LR > > C RETURN > > > > This is a test program and I kept the interface the same as your MI > example even > > though the object type should be a CHAR(2) rather than CHAR(10). Note > that in the RPG > > version both the object type and requested authority are 4-byte values > even though the > > machine uses 2-byte values. This is because the rslvsp C function being > used expects > > an int. I haven't investigated this state fully yet. Suffice it to say > the above > > appears to do what you want. Caveat emptor. > > > > Regards, > > Simon Coulter. > > > > «»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«» > > «» FlyByNight Software AS/400 Technical Specialists «» > > «» Eclipse the competition - run your business on an IBM AS/400. «» > > «» «» > > «» Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 «» > > «» Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au «» > > «» «» > > «» Windoze should not bepen at Warp speed. «» > > > > > __________________________________________________ > Do You Yahoo!? > Talk to your friends online with Yahoo! Messenger. > http://im.yahoo.com > +--- | This is the MI Programmers Mailing List! | To submit a new message, send your mail to MI400@midrange.com. | To subscribe to this list send email to MI400-SUB@midrange.com. | To unsubscribe from this list send email to MI400-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: dr2@cssas400.com +---
As an Amazon Associate we earn from qualifying purchases.
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.