Unable to execute DRAW Rexx program sample



IBM's Command List programming language & Restructured Extended Executor

Unable to execute DRAW Rexx program sample

Postby Aech » Wed Nov 24, 2021 9:11 pm

Hi,
I am trying to execute DRAW Rexx code supplied as an example in IBM manual below

https://www.ibm.com/docs/en/db2-for-zos/11?topic=examples-sample-db2-rexx-application

Also I have not modified anything in the code, I have just copy pasted from the IBM manual to my mainframe dataset, just changing the special character (^ to /), example
From:
SQLCODE ^= 0
To:
SQLCODE \= 0

And I am getting the below error.

  31 +++ BndSize = RightBnd - LeftBnd + 1                  
 Error running DRAW, line 31: Bad arithmetic conversion      


Could someone please help me.
Aech
 
Posts: 11
Joined: Mon Mar 05, 2018 2:50 pm
Has thanked: 6 times
Been thanked: 0 time

Re: Unable to execute DRAW Rexx program sample

Postby prino » Wed Nov 24, 2021 9:14 pm

@ line 30.5: say , say, say
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Unable to execute DRAW Rexx program sample

Postby Aech » Wed Nov 24, 2021 9:51 pm

Hi,

I tried to run a trace and this is what I could see

   30 *-* "ISREDIT (LEFTBND,RIGHTBND) = BOUNDS"      
       >>>   "ISREDIT (LEFTBND,RIGHTBND) = BOUNDS"    
       +++ RC(20) +++                                  
    31 *-* "ISREDIT (LRECL) = DATA_WIDTH" /*LRECL*/    
       >>>   "ISREDIT (LRECL) = DATA_WIDTH"            
       +++ RC(20) +++                                  
    32 *-* BndSize = RightBnd - LeftBnd + 1            
    32 +++ BndSize = RightBnd - LeftBnd + 1            
Error running DRAW, line 32: Bad arithmetic conversion
Aech
 
Posts: 11
Joined: Mon Mar 05, 2018 2:50 pm
Has thanked: 6 times
Been thanked: 0 time

Re: Unable to execute DRAW Rexx program sample

Postby sergeyken » Wed Nov 24, 2021 10:38 pm

DRAW must be invoked from the command line of an ISPF edit session.


Is that true in your case?
Javas and Pythons come and go, but JCL and SORT stay forever.

These users thanked the author sergeyken for the post:
Aech (Wed Dec 01, 2021 8:22 pm)
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Unable to execute DRAW Rexx program sample

Postby Aech » Wed Nov 24, 2021 10:48 pm

sergeyken wrote:
DRAW must be invoked from the command line of an ISPF edit session.


Is that true in your case?


Ahh It makes sense now.. It is working now when I tried to run the command inside a dataset. Good catch, thank you :D
Aech
 
Posts: 11
Joined: Mon Mar 05, 2018 2:50 pm
Has thanked: 6 times
Been thanked: 0 time

Re: Unable to execute DRAW Rexx program sample

Postby Pedro » Wed Nov 24, 2021 11:22 pm

It is an example of doing DB2 stuff, but it should be more robust. It should check for return codes from at least the first ISREDIT statement.

Often times, a RC 20 is an environment problem.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Unable to execute DRAW Rexx program sample

Postby sergeyken » Wed Nov 24, 2021 11:26 pm

Aech wrote:
sergeyken wrote:
DRAW must be invoked from the command line of an ISPF edit session.

Is that true in your case?

Ahh It makes sense now.. It is working now when I tried to run the command inside a dataset. Good catch, thank you :D


The DRAW developers had mandatory to add the verification statements at the very beginning: what is the environment where it has been called?
Especially when their sample is supposed to be the source of training for many others.
But people are (almost) always lazy doing these trivial checking, and hence later many, many people start hitting brick walls with their elbows... :cry:
Javas and Pythons come and go, but JCL and SORT stay forever.

These users thanked the author sergeyken for the post:
Aech (Wed Dec 01, 2021 8:21 pm)
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post