RUNSQLSTM command failed

1400 pts.
Tags:
rpfle
STRSQL
I have a CL program having the following RUNSQLSTM RUNSQLSTM SRCFILE(AMITS/AMITSRC) SRCMBR(LISTMSGF) I am receiving SQL9010 error when running the CL program... Any hint on where is the problem?

Answer Wiki

Thanks. We'll let you know when a new response is added.

The job should have produced a spoolf file with the SQL information. You should find the information there.

If not, start an SQL session, then cut and paste the SQL statement from the source file to the screen and try to run it.

Discuss This Question: 6  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Any hint on where is the problem?   Yes, the hint is "SQL9010". That message tells you exactly where to look.   Tom
    125,585 pointsBadges:
    report
  • 9783444184
    Message ID . . . . . . :   SQL9010                                             Date sent  . . . . . . :   01/07/07      Time sent  . . . . . . :   10:38:01                                                                                  Message . . . . :   RUNSQLSTM command failed.                                                                                                                 Cause . . . . . :   Errors were found while processing the source for the        RUNSQLSTM command.  The listing print file is *N in *N.                      Recovery  . . . :   Review the messages on the listing.  Either correct the      problems or specify a higher severity on the ERRLVL parameter. Try the         request again.                                                               Technical description . . . . . . . . :   The RUNSQLSTM command found errors     with a severity greater than the requested ERRLVL.                          
    1,400 pointsBadges:
    report
  • 9783444184
    here is the code.....CRTRPGMOD MODULE(AMITS/LISTMSGF)  SRCFILE(AMITS/QRPGLESRC)SRCMBR(LISTMSGF) CRTSRVPGM SRVPGM(LISTMSGF)  EXPORT(*ALL) ----------------------------------------------- CREATE FUNCTION AMITS/GetMessages(Library VARCHAR (10),                                                      MessageFile VARCHAR (10))                RETURNS TABLE ( MsgID CHAR (7 ),                                                        MsgSev DECIMAL (2 , 0),                                                 MsgDesc VARCHAR (500 ),                                                  MsgHelp VARCHAR (500 ))                                 LANGUAGE RPGLE                                                          EXTERNAL NAME 'AMITS/LISTMSGF(GETMESSAGES)'                            PARAMETER STYLE DB2SQL                                                   DISALLOW PARALLEL     NO SQL                NO FINAL CALL ------------------------------------------------- h nomain //*********************************************************** // Procedure: getMessages // Function: Retrieve message descriptions for all messages in a // given message file. Data is returned as an SQL table // function. //*************************************************************** d SQL_OK c '00000' d SQL_EOF c '02000' d SQL_FILE_NOT_FOUND... d c '00204' d ErrorDS ds Qualified d BytesReturned 10i 0 Inz(%Size(ErrorDS)) d BytesAvailable 10i 0 d MsgID 7a d 1a d MsgText 512a d getMessages pr * Input Parameters d inLibrary 10a Const varying d inMsgF 10a Const varying * Output Parameters d outMsgId 7a d outMsgSev 2 0 d outMsgDesc 500a varying d outMsgHelp 500a varying * NULL Indicators d niLibr 5i 0 d niMsgf 5i 0 d niMsgId 5i 0 d niMsgSev 5i 0 d niMsgDesc 5i 0 d niMsgHelp 5i 0 * SQL Info d SQLState 5 d FunctName 517a varying d SpecName 128a varying d SQLMsg 70a varying d CallType 10I 0 p getMessages b EXPORT d getMessages pi * Input Parameters d inLibrary 10a Const varying d inMsgF 10a Const varying * Output Parameters d outMsgId 7a d outMsgSev 2 0 d outMsgDesc 500a varying d outMsgHelp 500a varying * NULL Indicators d niLibr 5i 0 d niMsgf 5i 0 d niMsgId 5i 0 d niMsgSev 5i 0 d niMsgDesc 5i 0 d niMsgHelp 5i 0 * SQL Info d SQLState 5 d FunctName 517a varying d SpecName 128a varying d SQLMsg 70a varying d CallType 10I 0 dRetrieveMsg pr ExtPgm('QMHRTVM') d MsgInfo 32767a Options(*varsize) d RtnLength 10i 0 Const d RtnFormat 8a Const d MsgID 7a Const d QualMsgF 20a Const d RplData 32767a Options(*varsize) Const d RplDataLen 10i 0 Const d RplSubValue 10a Const d RtnCtlChar 10a Const d ErrorCode 500a d RtvOption 10a Const d CCSIDCnvTo 10i 0 Const Options(*Omit) d CCSIDRplDta 10i 0 Const Options(*Omit) dRTVM0300 ds Qualified d BytesReturned 10i 0 d BytesAvailable 10i 0 d MsgSev 10i 0 d AlertIndex 10i 0 d AlertOption 9a d LogPrb 1a d MsgID 7a d 3a d NbrSubValueFormat... d 10i 0 d CCSIDConvStsText... d 10i 0 d CCSIDConvRplDta... d 10i 0 d CCSIDRtnText 10i 0 d OffsetDftRpy 10i 0 d DftRpyRtnLen 10i 0 d DftRpyAvlLen 10i 0 d OffsetMsg 10i 0 d MsgLenRtn 10i 0 d MsgLenAvl 10i 0 d OffsetMsgHlp 10i 0 d MsgHlpRtnLen 10i 0 d MsgHlpAvlLen 10i 0 d OffsetSubVar... d 10i 0 d SubVarRtnLen... d 10i 0 d SubVarAvlLen... d 10i 0 d SubVarElement... d 10i 0 d 500a Varying d DftRpy 500a Varying d Msg 500a Varying d MsgHlp 500a Varying d SubVar 500a Varying d SQL_OK c '00000' d SQL_EOF c '02000' d SQL_FILE_NOT_FOUND... d c '00204' d ErrorDS ds Qualified d BytesReturned 10i 0 Inz(%Size(ErrorDS)) d BytesAvailable 10i 0 d MsgID 7a d 1a d MsgText 512a d MsgID s 7a d LogPrb s 4a d msgRtv s 10a STATIC d lastMsg s 7a STATIC /free SQLState = SQL_OK; if calltype = -1; if niLibr = 1 OR niMsgf = 1; SQLState=SQL_FILE_NOT_FOUND; msgRtv = ''; *INLR = *ON; Return; ENDIF; lastMsg = ''; msgRtv = '*FIRST'; else; msgRtv = '*NEXT'; ENDIF; RetrieveMsg( RTVM0300 : %Len(RTVM0300) : 'RTVM0300' : LastMsg : inMsgF + inLibrary : ' ' : 1 : '*NO' : '*NO' : ErrorDS : msgRtv : 0 : 0 ); If ErrorDS.BytesAvailable <> 0; exsr setEOF; Else; If RTVM0300.MsgID <> ''; outMsgId = RTVM0300.MsgId; outMsgSev = RTVM0300.MsgSev; outMsgDesc = %subst( RTVM0300 : RTVM0300.OffsetMsg+1 : RTVM0300.MsgLenRtn); outMsgHelp = %subst( RTVM0300 : RTVM0300.OffsetMsgHlp+1 : RTVM0300.MsgHlpRtnLen); lastMsg = outMsgId; else; exsr setEOF; EndIf; EndIf; Return; Begsr setEOF; outMsgId = ''; outMsgSev = 0; outMsgDesc = ''; outMsgHelp = ''; SQLState = SQL_EOF; msgRtv = ''; *InLR = *On; niMsgID = 1; niMsgID = 1; niMsgID = 1; niMsgID = 1; lastMsg = ''; ENDSR; /end-free p getMessages e
    1,400 pointsBadges:
    report
  • TomLiotta
    here is the code…..   Here is the code for what? Is all of that what was in the LISTMSGF source member?   If it was, then it should have failed totally. The only part that would be valid is the single CREATE FUNCTION statement. None of the rest is SQL.   The rest is either CL or RPG source. Neither of those can be executed in RUNSQLSTM.   Tom
    125,585 pointsBadges:
    report
  • 9783444184
    i have taking reference from herehttp://www.mcpressonline.com/programming/sql/getting-the-message-using-an-sql-udtf.htmlis was not ok....
    1,400 pointsBadges:
    report
  • CharlieBrowne
    What are the lower level messages in the joblog?
    41,380 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following