Page 1 of 1

Rexx Error - COMMAND USING NOT FOUND

PostPosted: Mon Nov 07, 2011 7:09 pm
by sikosc
Hi,

I'm trying to execute a program in rexx and i'm getting this error

COMMAND USING NOT FOUND OR REXX IDENTIFIER IS MISSING+
SUPPLY '/* REXX */' AS THE FIRST RECORD TO EXECUTE AS A REXX EXEC OR, FOR AN EX
PLICIT EXEC, SUPPLY THE EXEC KEYWORD ON THE EXEC COMMAND

here's my program

/* LIST DB2 TABLES WITH LOCKSIZE ROWS OR PAGE,               
    USING THE DYNAMIC SQL INTERFACE */                       
                                                             
/* REXX */                                                   
                                                             
  ARG DB USER PASSWORD                                       
                                                             
/* CONNECT THE TARGET DATABASE. EXIT IF CONNECT FAILS. */     
  R = REXXSQL("CONNECT" USER "IDENTIFIED BY" PASSWORD "TO" DB)
  IF SQLCODE < 0 THEN EXIT 8                                 
                                                             
/* PREPARE AND EXECUTE A SELECT ON SYSCATALOG. */             
  S = "SELECT CREATOR,TNAME,LOCKSIZE FROM SYSTEM.SYSCATALOG" ,
      "WHERE LOCKSIZE = ROW"                                 
      "OR LOCKSIZE = PAGE"                                   
  R = REXXSQL(S)                                             
    DSLIST   CTMPNLD  DBT      ISR@D0A0 *DSLIST               
                                                         
/* CHECK FOR SQL ERRORS. */                             
  IF SQLCODE <> 0 THEN SIGNAL SQL_ERROR                 
                                                         
/* SHOW THE RESULT STEMS CREATOR, TNAME AND LOCKSIZE */ 
  DO I = 1 TO _NROWS                                     
    TABLENAME = STRIP(CREATOR.I)"."STRIP(TNAME.I)       
    SAY "TABLE" TABLENAME "HAS" LOCKSIZE.I "ROWS"       
  END                                                   
/* TERMINATE */                                         
                                                         
  R=REXXSQL("COMMIT")                                   
  EXIT


thanks

Re: rexx

PostPosted: Mon Nov 07, 2011 7:12 pm
by prino
Put your exec in a dataset concatenated to the SYSEXEC DD name, or start it with
/* REXX */
.

Re: rexx

PostPosted: Mon Nov 07, 2011 10:27 pm
by dick scherrer
Hello and welcome to the forum,

If you intend to participate (post) here you will have to post in the correct part of the forum (this is NOT a db2 question - it is a rexx question) and use a meaningful subject (using rexx is worthless as a subject).

d

Re: rexx

PostPosted: Tue Nov 08, 2011 2:06 am
by NicC
For some reason - possibly because /* Rexx */ is not your first line it is assuming that the word USING on the second line is a command. If you are going to put a comment before /* Rexx */ then do not split the comment across lines i.e. star and end each line of the comment with the /* */ pair.

Re: rexx

PostPosted: Tue Nov 08, 2011 2:12 am
by Akatsukami
dick scherrer wrote:Hello and welcome to the forum,

If you intend to participate (post) here you will have to post in the correct part of the forum (this is NOT a db2 question - it is a rexx question) and use a meaningful subject (using rexx is worthless as a subject).

d

But the next question will be, "How come my call to REXXSQL is not working?", at which point it will become a DB2 problem :mrgreen:

Re: rexx

PostPosted: Tue Nov 08, 2011 2:13 am
by NicC
but that is another question so another topic which CAN be in the DB2 section - but reading the manual should work - did for a dunce like me!

Re: rexx

PostPosted: Tue Nov 08, 2011 11:38 am
by sikosc
NicC wrote:For some reason - possibly because /* Rexx */ is not your first line it is assuming that the word USING on the second line is a command. If you are going to put a comment before /* Rexx */ then do not split the comment across lines i.e. star and end each line of the comment with the /* */ pair.



thanks a lot NicC this was helpful