Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CLIST and REXX function contrast book

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: CLIST and REXX function contrast book
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Sun Apr 01, 2012 9:23 pm    Post subject: Reply to: CLIST and REXX function contrast book
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Fri Apr 06, 2012 9:30 pm    Post subject: Reply to: CLIST and REXX function contrast book
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    Post subject:
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

Senior Member


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

PostPosted: Mon Apr 09, 2012 6:36 pm    Post subject: Reply to: CLIST and REXX function contrast book
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us