IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

CLIST and REXX function contrast book


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sun Apr 01, 2012 6:55 am
Reply with quote

hi,
I want to change a CLIST program provided by IBM, which is named 'ISRBOX' to REXX, but it does not behavior , can you please point out where I was wrong during the conversion?
code is as below:
Code:
000001 /******************************REXX***********************************/
000002 /* */                                                                   
000003 /* 5647-A01 (C) COPYRIGHT IBM CORP 1995, 2003 */                       
000004 /* */                                                                   
000005 /* ISRBOX - Draw a box with its upper left corner at the */             
000006 /* cursor position */                                                   
000007 /*  MODIFIED BY JETZHU, 2012.3.31    CHAGNED TO REXX VERSION */         
000008 /*********************************************************************/
000009 Address ISPEXEC                                                         
000010 "ISREDIT MACRO "                                                       
000011 "ISREDIT (ROW,COL) = CURSOR" /* Get cursor position */                 
000012 SAY 'ROW: ' ROW 'COL: ' COL                                             
000013 "ISPEXEC CONTROL ERRORS RETURN" /* No macro error panel */             
000014 /* Draw box over existing */                                           
000015 /* lines */                                                             
000016 "ISREDIT LINE &ROW     = LINE + < &COL +--------------------+> "       
000017 "ISREDIT LINE &(ROW+1) = LINE + < &COL |                    |> "       
000018 "ISREDIT LINE &(ROW+2) = LINE + < &COL |                    |> "       
000019 "ISREDIT LINE &(ROW+3) = LINE + < &COL |                    |> "       
000020 "ISREDIT LINE &(ROW+4) = LINE + < &COL |                    |> "       
000021 "ISREDIT LINE &(ROW+5) = LINE + < &COL +--------------------+>"         
000022 IF RC > 0 THEN DO /* If error occurred while */                         
000023 "  SET ZEDSMSG = &STR(INCOMPLETE BOX)" /* overlaying lines */           
000024 "  SET ZEDLMSG = &STR(NOT ENOUGH LINES/COLUMNS TO DRAW COMPLETE BOX)"   
000025 "  ISPEXEC SETMSG MSG(ISRZ001)" /* Issue error message */               
000026 END                                                                     
000027 "SET &COL = &COL + 2" /* Position cursor within */                     
000028 "SET &ROW = &ROW + 1" /* the box */                                     
000029 "ISREDIT CURSOR = (ROW,COL) "                                           
000030 EXIT 0                                                                 
****** **************************** Bottom of Data ****************************


I want to have a summary of CLIST and REXX function contrast, where can I find it? thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sun Apr 01, 2012 7:23 am
Reply with quote

can't find a better write-up about Comparisons Between CLIST and REXX.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sun Apr 01, 2012 9:24 am
Reply with quote

Thanks, Dick,

It's just at the end of <<REXX user's guide>>,

I did not notice it, sorry......

thanks for your kind help!
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Sun Apr 01, 2012 9:23 pm
Reply with quote

Code:
000009 Address ISPEXEC                                                         
000010 "ISREDIT MACRO "                                                       
000011 "ISREDIT (ROW,COL) = CURSOR" /* Get cursor position */


I think you should switch your addressing mode:
Code:
000009 Address ISREDIT                                                         
000010 "MACRO "                                                       
000011 "(ROW,COL) = CURSOR" /* Get cursor position */
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Apr 06, 2012 2:57 pm
Reply with quote

I have modified the above sample source according to REXX grammer,
Code:
  trace i                                                         
Address ISPEXEC                                                   
"ISREDIT MACRO "                                                   
"ISREDIT (ROW,COL) = CURSOR" /* Get cursor position */             
"ISPEXEC CONTROL ERRORS RETURN" /* No macro error panel */         
/* Draw box over existing */                                       
/* lines */                                                       
"ISREDIT LINE " ROW "= LINE + < " COL "+--------------------+> "   
 ROW = ROW + 1                                                     
"ISREDIT LINE " ROW "= LINE + < " COL "+--------------------+> "   
 ROW = ROW + 1                                                     
"ISREDIT LINE " ROW "= LINE + < " COL "|                    |" ">"
 ROW = ROW + 1                                                     
"ISREDIT LINE " ROW "= LINE + < " COL "|                    |> "   
 ROW = ROW + 1                                                     
"ISREDIT LINE " ROW "= LINE + < " COL "|                    |> "   
 ROW = ROW + 1                                                     
"ISREDIT LINE " ROW "= LINE + < " COL "+--------------------+>"   
IF RC > 0 THEN DO /* If error occurred while */                   
"  ZEDSMSG = " 'INCOMPLETE BOX)' /* overlaying lines */           
"  ZEDLMSG = " 'NOT ENOUGH LINES/COLUMNS TO DRAW COMPLETE BOX'     
"  ISPEXEC SETMSG MSG(ISRZ001)" /* Issue error message */         
END                                                               
COL = COL + 2 /* Position cursor within */                         
ROW = ROW + 1 /* the box */                                       
"ISREDIT CURSOR = (ROW,COL) "                                     
EXIT 0                                                             


but the result seems quite strange:
Code:
****** ***************************** Top of Data *****
001200 TEST-#         +--------------------+         
001300 TEST-#         +--------------------+         
001400 TEST-#                                         
001500 TEST-#                                         
001600 TEST-#                                         
001700 TEST-#         +--------------------+         
001800 TEST-#                                         
001900 TEST-#                                         
002000 TEST-#                                         
****** **************************** Bottom of Data ***

+--------------------+ can be successfully drawn, but strings like "| |"which contain blank cannot be drawn

can you please give me a hint?
thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 06, 2012 8:25 pm
Reply with quote

could be the single | starts a parse for the concatenation operator ||,
thus does not include it in the 'literal' generated for the LINE command.

try changing the | to a character that you do not use
or change the | to ## (that's two hash/lbs marks.
then after you have done all the LINE commands,
do a change all '##' '|'
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Apr 06, 2012 9:30 pm
Reply with quote

You have:
Code:
  trace i   

It is strange that you did not see something in the trace.

Your syntax is incorrect. I am surprised the other lines gave you something. I believe the plus sign is part of the syntax of the data text.

Use single quote characters around your data:
Code:
Address ISREDIT
"LINE " ROW "= LINE + < " COL "'+--------------------+'> "
 ROW = ROW + 1                                           
"LINE " ROW "= LINE + < " COL "'|                    |'>"
 ROW = ROW + 1                                           
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Apr 09, 2012 6:50 am
Reply with quote

hi, Pedro,

thanks for your information.
after I modified the source according to your sggestions, program worked fine...
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Apr 09, 2012 6:36 pm
Reply with quote

Quote:
It is strange that you did not see something in the trace.

My point was that the trace showed RC=20 for the lines that did not work. You should have noticed it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top