Midrange News for the IBM i Community


Posted by: WestCoastGuy
Trouble with RUNSQL command
has no ratings.
Published: 20 Mar 2012
Revised: 23 Jan 2013 - 3448 days ago
Last viewed on: 03 Jul 2022 (9119 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Trouble with RUNSQL command Published by: WestCoastGuy on 20 Mar 2012 view comments(9)

I have a RUNSQL statement in my CL program -

RUNSQL REQUEST(&QRYSLT) OUTPUT(*OUTFILE) +
    OUTFILE(IA#REPORT) MBROPT(*ADD)      

 

The sql statement is

select * from kevinv/ia#lchsd where hsacno = '10028 '  and hscucd = 'USD'  and hsatro = 'C'  and hsupsn = '11628'  and hsupso = 'BQ'  and hspdat >= 20110401   and hspdat <= 20110531                  

 

The outfile file name is a copy of the queried file , ia#lchsd.

Here is the part of the job log when it runs;

  5500 - CHKOBJ OBJ(*LIBL/IA#REPORT) OBJTYPE(*FILE) MBR(*FIRST)         
  6600 - CPYF FROMFILE(' '/RUNSQL) TOFILE(*LIBL/IA#REPORT) TOMBR(*FIRST)
  MBROPT('*ADD') FMTOPT(*NOCHK)                                         
 15400 - RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID)                           
 15600 - SNDPGMMSG MSGID(CPD0078) MSGF(QCPFMSG) MSGDTA(X'00000001D6C2D1')
  MSGTYPE(*DIAG)                                                        
Value  for parameter OBJ not a valid name.    

   Error found on CHKOBJ command.                                   
 15400 - RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID)                    
 15600 - SNDPGMMSG MSGID(CPD0078) MSGF(QCPFMSG)                  
  MSGDTA(X'00000001D6E4E3C6C9D3C5') MSGTYPE(*DIAG)               
Value  for parameter OUTFILE not a valid name.                   
 15400 - RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID)                    
 15600 - SNDPGMMSG MSGID(CPF0001) MSGF(QCPFMSG) MSGDTA('STRQMQRY')
  MSGTYPE(*DIAG)                                                 
Error found on STRQMQRY command.                                 
 15400 - RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID)                    
 15600 - SNDPGMMSG MSGID(CPD0078) MSGF(QCPFMSG)                  
  MSGDTA(X'00000001C6D9D6D4C6C9D3C5') MSGTYPE(*DIAG)             
Value  for parameter FROMFILE not a valid name.                  
                                                                 

Thanks in advance!

                       

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS