Rexx Error - COMMAND USING NOT FOUND



IBM's flagship relational database management system

Rexx Error - COMMAND USING NOT FOUND

Postby sikosc » Mon Nov 07, 2011 7:09 pm

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
sikosc
 
Posts: 5
Joined: Mon Nov 07, 2011 7:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: rexx

Postby prino » Mon Nov 07, 2011 7:12 pm

Put your exec in a dataset concatenated to the SYSEXEC DD name, or start it with
/* REXX */
.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: rexx

Postby dick scherrer » Mon Nov 07, 2011 10:27 pm

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
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: rexx

Postby NicC » Tue Nov 08, 2011 2:06 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: rexx

Postby Akatsukami » Tue Nov 08, 2011 2:12 am

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:
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: rexx

Postby NicC » Tue Nov 08, 2011 2:13 am

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!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: rexx

Postby sikosc » Tue Nov 08, 2011 11:38 am

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
sikosc
 
Posts: 5
Joined: Mon Nov 07, 2011 7:02 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post