Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Akash Sharma

New User

Joined: 13 Jan 2009
Posts: 36
Location: India

 Posted: Thu Jan 22, 2009 6:41 pm    Post subject: Problem using arithmetic operators. 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.

enrico-sorichetti

Global Moderator

Joined: 14 Mar 2007
Posts: 10457
Location: italy

Posted: Thu Jan 22, 2009 6:48 pm    Post subject: Reply to: Problem using arithmetic operators.

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
in this case You are not likely to get too much help
Akash Sharma

New User

Joined: 13 Jan 2009
Posts: 36
Location: India

Posted: Thu Jan 22, 2009 7:56 pm    Post subject: Re: Reply to: Problem using arithmetic operators.

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?
expat

Global Moderator

Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

Posted: Thu Jan 22, 2009 8:05 pm    Post subject:

Have you tried
 Code: SET &RSTR = &STR(-)
Akash Sharma

New User

Joined: 13 Jan 2009
Posts: 36
Location: India

Posted: Thu Jan 22, 2009 8:24 pm    Post subject:

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    ***
expat

Global Moderator

Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

 Posted: Thu Jan 22, 2009 8:33 pm    Post subject: 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.
Akash Sharma

New User

Joined: 13 Jan 2009
Posts: 36
Location: India

Posted: Thu Jan 22, 2009 8:55 pm    Post subject:

 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....
Akash Sharma

New User

Joined: 13 Jan 2009
Posts: 36
Location: India

Posted: Thu Jan 22, 2009 9:02 pm    Post subject: Reply to: Problem using arithmetic operators.

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.....
Akash Sharma

New User

Joined: 13 Jan 2009
Posts: 36
Location: India

 Posted: Fri Jan 23, 2009 2:58 pm    Post subject: Reply to: Problem using arithmetic operators. Hi All, Looked extensively into the manuals...but could not figure out the way ahead. Could you please help here?
Pedro

Senior Member

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

Posted: Sat Jan 24, 2009 2:41 am    Post subject: Reply to: Problem using arithmetic operators.

Have you tried the 'no substitution' function?

 Code: &SYSNSUB(level,expression)
Akash Sharma

New User

Joined: 13 Jan 2009
Posts: 36
Location: India

Posted: Tue Jan 27, 2009 1:14 pm    Post subject: Re: Reply to: Problem using arithmetic operators.

Pedro wrote:

Have you tried the 'no substitution' function?

 Code: &SYSNSUB(level,expression)

Thanks a lot.
This worked.
Everything working fine now.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Having a problem FTP'ng to the MF pahiker All Other Mainframe Topics 2 Fri Nov 10, 2017 8:20 pm LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us