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

Problem using arithmetic operators.


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Thu Jan 22, 2009 6:41 pm
Reply with quote

HI All,

I have developed an ISPF Panel. In the ISPF Panel, there is an input field. Whatever is there in the input field, should get stored on to a PDS through a CLIST. The functionality is working fine, but i am facing 1 problem.

Whenever i give input as
ABC-DEF
or any other arithmetic operators, the program fails to store it into PDS.
Could you please help here???

I have tried defining many things in VER ####,

VER (&STYPE,NB,####,MSG=SRCH020)

but cant get through.

Please help.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jan 22, 2009 6:48 pm
Reply with quote

Quote:
Could you please help here???

NO without any additional info

You did not post anything useful,
post Your rexx ( using the code tags )
both the original source
and a run with TRACE "I" turned on

are You really using a CLIST icon_eek.gif
in this case You are not likely to get too much help
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Thu Jan 22, 2009 7:56 pm
Reply with quote

Hi Enrico,

Following is the exact problem im facing.

Code:


PROC 0                                                             
ALLOCATE FILE(RSTR) DA('EV4.RT.SCH.QUEUE') MOD REU   
OPENFILE RSTR OUTPUT                                           
SET &RSTR = -                                                   
WRITE LASTCC1 = &LASTCC                                           
PUTFILE RSTR                                                   
WRITE LASTCC2 = &LASTCC                                           
CLOSFILE RSTR                                                   
EXIT CODE(0)                                                       




The error response is:

Code:


SET &RSTR = WRITE LASTCC1 = 0                                   
THIS STATEMENT HAS AN EXPRESSION WITH OPERATORS OUT OF SEQUENCE   
***                                                               



This error i believe is coming because of - being the symbol for continuation in next line. How can i handle this?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jan 22, 2009 8:05 pm
Reply with quote

Have you tried
Code:

SET &RSTR = &STR(-)
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Thu Jan 22, 2009 8:24 pm
Reply with quote

expat wrote:
Have you tried
Code:

SET &RSTR = &STR(-)


Hi expat,

That almost solved my problems.

But it still fails for &.
ie the code fails if :

Code:

PROC 0                                                             
ALLOCATE FILE(RSTR) DA('EV4.RT.SCH.QUEUE') MOD REU   
OPENFILE RSTR OUTPUT                                           
SET &RSTR = &STR(&)                                                   
WRITE LASTCC1 = &LASTCC                                           
PUTFILE RSTR                                                   
WRITE LASTCC2 = &LASTCC                                           
CLOSFILE RSTR                                                   
EXIT CODE(0)   


The O\P is:

Code:

SET &RSTR = &STR(&)                             
THIS STATEMENT HAS AN INVALID SYMBOLIC VARIABLE   
***                                               
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jan 22, 2009 8:33 pm
Reply with quote

Well it amazes me that I even remembered &STR as it's over 20 years since I wrote or even looked at a CLIST.

There is a variation on &STR - might be &NSTR or something like that. Take a look in the manuals and see.
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Thu Jan 22, 2009 8:55 pm
Reply with quote

expat wrote:
Well it amazes me that I even remembered &STR as it's over 20 years since I wrote or even looked at a CLIST.

There is a variation on &STR - might be &NSTR or something like that. Take a look in the manuals and see.



Hi,

I looked into the manuals.
U were right, &NRSTR is the command for &
but it works for if there are even nos of &s
like &&, &&&&.
but not for odd....icon_sad.gif
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Thu Jan 22, 2009 9:02 pm
Reply with quote

Just to add here,

if i have,

case1

Code:

SET &ROBTSTR = &NRSTR(&)


o\p is

Code:

SET &ROBTSTR = &NRSTR(&)                         
THIS STATEMENT HAS AN INVALID SYMBOLIC VARIABLE 


case 2
Code:

SET &ROBTSTR = &NRSTR(STRA&STRB)


the o\p written to pds is STRA

case3

Code:

SET &ROBTSTR = &NRSTR(STRA&&STRB)


the o\p written is STRA&&STRB

But the o\p should be exactly the same what input is for all the cases.....
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Fri Jan 23, 2009 2:58 pm
Reply with quote

Hi All,

Looked extensively into the manuals...but could not figure out the way ahead. Could you please help here?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Jan 24, 2009 2:41 am
Reply with quote

Please try using rexx instead of clist.

Have you tried the 'no substitution' function?

Code:
&SYSNSUB(level,expression)
Back to top
View user's profile Send private message
Akash Sharma

New User


Joined: 13 Jan 2009
Posts: 36
Location: India

PostPosted: Tue Jan 27, 2009 1:14 pm
Reply with quote

Pedro wrote:
Please try using rexx instead of clist.

Have you tried the 'no substitution' function?

Code:
&SYSNSUB(level,expression)


Thanks a lot.
This worked.
Everything working fine now. icon_smile.gif
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top