QHSMMOVL API in a CLLE program

315 pts.
Tags:
CLLE
IASP
RPGLE
I am trying to use QHSMMOVL API in a CLLE program to move libraries between ASP's (1-32) and iASPS(33-256). I keep getting the error CPFB79E -  Auxiliary storage pool does not exist or CPF3C3C Value for parameter not valid. I think it has something to do with the Target auxiliary storage pool (ASP) number parameter defined as BIN 4. I originally used CLLE to call that API, i used %BIN to convert a 4 character field to binary then i passed that variable to the target auxiliary storage pool parameter, didn't work. Alternatively I used RPGLE to call the API, and defined the field as 4 B 0 as part of a data structure then passed that to the API, still didn't work. Does someone happen to have a sample code that correctly defines and uses the QHSMMOVL API parameters to make it work correctly? What is the correct way of defining and using the BIN parameter for the target ASP parameter? Should i use a CHAR or DEC variable and pass it to the BIN target ASP parameter? What is the correct length of the variable that i should use to make this work? I am using IBM i v7r2 with *SYSBAS, ASP 2, and iASPS configured and varied on. Thanks in advance.


Software/Hardware used:
IBM i v7r2 with iASPS configured and varied on
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    We need to see you CLLE code in order to know what is wrong with it. It seems likely that you have defined the parameter wrong, ut we can't see what you did, so we can't correct it.

    In RPGLE, 4B 0 is definitely wrong. The data typw would not be "B". You really shouldn't be using the "B" data type for anything except some old file fields that might have used it.
    34,485 pointsBadges:
    report
  • Jpjawili
    @TheRealRaven thanks very much for your reply, i was able to make it work last night. I realized that the CPF3C3C  error message was actually for the 5th (optional) parameter. I checked and i actually was passing the correct parameter already to the  Target auxiliary storage pool (ASP) number  parameter (checked in debug eval var:x). I excluded the optional parameters from my PLIST and it worked. 

    Again thanks very much for your attention. 
    315 pointsBadges:
    report
  • TheRealRaven
    Good you got it working.

    Should i use a CHAR or DEC variable and pass it to the BIN target ASP parameter?

    That made for some uncertainty.

    You shouldn't use *CHAR nor *DEC. The parameter is a *INT data type. Back before V5R2 of the OS, the *INT data type wasn't available; so a 4-byte *CHAR variable would be set with %BIN().

    Now, just use *INT. By default, it's a binary 4-byte integer, numeric value. You can also specify it as a 2-byte integer. In some cases, you might want to use *UINT instead, which declares an unsigned integer.
    34,485 pointsBadges:
    report
  • TheRealRaven
    In RPG, it would be 10I 0 for a 4-byte integer (and 10U 0 for unsigned). The "10" says that it can hold "10 digits".

    If you use 4B 0, it would mean it could hold "4 digits", so maximum value would be 9999. For a  binary integer, that limits it to two bytes. But because it's a "B" data type, there is an additional restriction on maximum value even though 2 bytes could hold larger integer values.

    That's a major reason why the "B" data type should be avoided for integers.

    But the data type does have one unusual characteristic. It provides a way to store precise decimal fractions in a "binary" field. So 4B 2 is a valid specification that has two decimal fraction digits. You can't do the same with "I" and "U" data types. Those are always integer values.

    There's essentially never a reason to use the "B" data type for RPG memory variables. The only real use today is for old files that might have fields defined in that way. Those should be rare, and you might never see one.
    34,485 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: