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
 

 

Problem using arithmetic operators.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Problem using arithmetic operators.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Thu Jan 22, 2009 6:48 pm    Post subject: Reply to: Problem using arithmetic operators.
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    Post subject: Re: Reply to: Problem using arithmetic operators.
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 22, 2009 8:05 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 22, 2009 8:33 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Problem using arithmetic operators.
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    Post subject: Reply to: Problem using arithmetic operators.
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

Senior Member


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

PostPosted: Sat Jan 24, 2009 2:41 am    Post subject: Reply to: Problem using arithmetic operators.
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    Post subject: Re: Reply to: Problem using arithmetic operators.
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 37 Tue Dec 06, 2016 8:04 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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