Thanks for replying Jack. The commands you reference do not exist on our
systems. We do have library QHASM and we are on 6.1. The only command in
the library is WRKCLU.


Jack Kingsley wrote on 05/14/2012 10:16:54 AM:

From: Jack Kingsley <iseriesflorida@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 05/14/2012 10:17 AM
Subject: Re: API QcstListClusterResourceGroupIn error
Sent by: midrange-l-bounces@xxxxxxxxxxxx

I wasn't aware of these API's. Do have a question are you aware of the
these commands in library QHASM.
RTVASPSSN
RTVCLU
RTVCRG




On Mon, May 14, 2012 at 10:02 AM, <mgarrison@xxxxxxxxxx> wrote:

I have written a program to try and retrieve the Current Node's Role
in a
HA Cluster. I need to know if the current system is the Primary
system or
a Backup System. When running the program I am receiving the
following
error when executing the QcstListClusterResourceGroupIn. Can anyone
tell
me what I am doing wrong as I have spent a lot of time looking at it
and I
just don't see the problem.

Additional Message Information

Message ID . . . . . . : CPF3CF1 Severity . . . . . . . : 40
Message type . . . . . : Diagnostic
Date sent . . . . . . : 05/14/12 Time sent . . . . . . :
07:54:18

Message . . . . : Error code parameter not valid.
Cause . . . . . : The format of the error code parameter is not
correct.
Recovery . . . : Correct the error code parameter and try the
request

again. If you do not know the correct format for the error code
parameter,
see the APIs topic collection in the Programming category in the
i5/OS

Information Center, http://www.ibm.com/systems/i/infocenter/.


The code for the program is as follows:

H/include *libl/UTILSRC,GugIHSpec

*š Create user space API
D API_CreateUserSpace...
D pr extpgm( 'QUSCRTUS' )
D SpcNamQ 20a const
D ExtAtr 10a const
D InzSiz 10i 0 const
D InzVal 1a const
D PubAut 10a const
D Text 50a Const
D Replace 10a Const Options( *NoPass )
D Error 32767a Options( *NoPass:
*VarSize )
D Domain 10a Const Options( *NoPass )

*š Delete User Space API
D API_DltUsrSpc pr extpgm( 'QUSDLTUS' )
D SpcNamQ 20a const
D Error 32767a options( *varsize )

*š Retrieve User Space API
D API_RtvUsrSpc pr extpgm( 'QUSRTVUS' )
D iSpcNamQ 20a const
D iStartPos 10i 0 const
D iDataLength 10i 0 const
D oRcvVar 32767a options( *varsize )
D ioErrorCode 32767a options( *varsize )

*š API error data structure
D dsLRGI0100 ds
D NodeId 8a
D CurrNodeRole 10i 0
D MemberStatus 10i 0
D PreferredRole 10i 0

*š Cluster Resource Group data structure
D dsCRGinfoUsrSpc...
D ds qualified
D USRSPC_Q 20a inz( '#RTVCRGLSTGUSYS ')
D EXT_ATR 1a inz( ' ' )
D USP_SIZ 10i 0 inz( 65535 )
D INZ_VAL 1a inz( x'00' )
D PUB_AUT 10a inz( '*CHANGE' )
D TXT_DSC 50a inz( 'List Cluster Resource
Group' )
D USP_RPL 10a inz( '*YES' )

D ds
D vResultsInfo 30a inz
D vResultsQue 10a overlay( vResultsInfo : 1 )
D vResultsLib 10a overlay( vResultsInfo :
*next
)
D vResultsRsv 10a overlay( vResultsInfo :
*next
)
D inz( *loval )

*š Stand-alone variable definitions
D vClusterName s 10a inz
D vCRGName s 10a inz( ' ' )
D vFormatName s 8a inz( 'LRGI0100' )
D vReqHandle s 16a inz
D vRtvCluVarLen s 10i 0 inz
D vRtvCluFormat s 8a inz( 'RCLI0100' )
D vUserSpace s 20a inz

D/copy QSYSINC/QRPGLESRC,QCSTCTL1
D/copy QSYSINC/QRPGLESRC,QCSTCRG3
D/copy QSYSINC/QRPGLESRC,QUSEC

/free

//š Set SQL options
exec sql set option commit = *none, alwcpydta = *optimize,
closqlcsr = *endmod, DLYPRP = *yes, datfmt = *iso, TIMFMT =
*iso;

//š Delete any previous User Space for Cluster Resource Group
API_DltUsrSpc( dsCRGinfoUsrSpc : QUSEC );

//š Create User Space for Cluster Resource Group
API_CreateUserSpace( dsCRGinfoUsrSpc.USRSPC_Q
: dsCRGinfoUsrSpc.EXT_ATR : dsCRGinfoUsrSpc.USP_SIZ
: dsCRGinfoUsrSpc.INZ_VAL : dsCRGinfoUsrSpc.PUB_AUT
: dsCRGinfoUsrSpc.TXT_DSC : dsCRGinfoUsrSpc.USP_RPL
: QUSEC );

vUserSpace = dsCRGinfoUsrSpc.USRSPC_Q ;
exsr GETCRG ;

//š Retrieve the User Space for Cluster Resource Group

//š Delete any previous User Space for Cluster Resource Group
API_DltUsrSpc( dsCRGinfoUsrSpc : QUSEC );

*inlr = *on ;
return ;

/end-free

C GETCRG begsr

C clear QUSEC
C eval vRtvCluVarLen = %len(QCSI010001)

C callb QCSTRCI
C parm QCSI010001
C parm vRtvCluVarLen
C parm vRtvCluFormat
C parm QUSEC

C clear QUSEC

C eval vClusterName = QCSCN03
C callb QCSTLCRG
C parm vReqHandle
C parm vUserSpace
C parm vFormatName
C parm vClusterName
C parm vCRGName
C parm vResultsInfo
C parm QUSEC

C endsr

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