|
I am trying to use the QCAPCMD API. I keep having a problem...one that just does not make sense to me. The error is that the length of Parm 2 is not valid. I have tried different length values for this parm, but no luck. Now I have the length defined as the size of the command parm. The problem parm is $$CmdLth. The error message is as follows: Message ID . . . . . . : CPF3C1D Severity . . . . . . . : 30 Message type . . . . . : Escape Date sent . . . . . . : 08/10/00 Time sent . . . . . . : 17:44:59 Message . . . . : Length specified in parameter 2 not valid. Cause . . . . . : The length of 19660801 for parameter 2 is not valid. Values for this parameter must be greater than 0 and less than 32703. Recovery . . . : Correct the length and call the API again. When I run it in debug and check the value of the parm, the value shows 300. I am confused by this one. Does anyone have any helpful advice? My code is as follows: P CLCommand B Export D CLCommand PI 10I 0 D Command 300A Const * D CommandExc PR ExtPgm('QCAPCMD') D Command 300A Const D Length 4B 0 D OptCtlBlck2 Like(OptCtlBlock) D OptCtlLngth 4B 0 D OptFormat 8A D ChgCommand 300A D ChgLgthIn 4B 0 D ChgLgthOut 4B 0 D Error2 Like(Error) *----------------------------------------------------* * API Call Options Control Breakdown * *----------------------------------------------------* D OptCtlBlock DS D CmdType 4B 0 Inz(0) D DBCSDta 1A Inz('0') D Prmptr 1A Inz('0') D Syntax 1A Inz('0') D MsgKey 4A Inz D Resvd 9A *----------------------------------------------------* * API Call Error Information Breakdown * *----------------------------------------------------* D Error DS D BytPrv 9B 0 Inz D BytAva 9B 0 Inz D MsgId 7 Inz D Err### 1 Inz D MsgDta 200 Inz *----------------------------------------------------* * Miscellaneous Variables * *----------------------------------------------------* D $$CmdLth S 4B 0 Inz(%Size(Command)) D $$OptLen S 4B 0 Inz(%Size(OptCtlBlock)) D $$OptFmt S 8A Inz('CPOP0100') D $$ChgCmd S 300A Inz D $$ChgLI S 4B 0 Inz(%Size($$ChgCmd)) D $$ChgLO S 4B 0 Inz * C CallP CommandExc(Command:$$CmdLth:OptCtlBlock: C $$OptLen:$$OptFmt:$$ChgCmd: C $$ChgLI:$$ChgLO:Error) * * Check for the value to return * C If BytAva = 0 C Return 0 C Else C Return 1 C EndIf * P E * Mike Silvers Hainey Business Systems 8 E. Canal St Dover, PA 17315 Branch Office: (410) 397-8739 Phone: (800) 932-3380 Fax: (717) 292-9474 Web: http:\\www.hbs-inc.com ________________________________ Providing E-Commerce, EDI, AS/400 Development and related services nationwide. ________________________________ +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.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.