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

How to use CHARIN Funtion is REXX


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pj2810

New User


Joined: 07 Aug 2012
Posts: 4
Location: india

PostPosted: Tue Aug 07, 2012 11:03 am
Reply with quote

Hi,
I am trying to write REXX program using CHARIN function.
But getting following error
Code:
    14 +++ VAR1 = CHARIN ( INPUT, 1, 20)                     
Error running CHARIN1, line 14: Unexpected "," or ")"       
Code that i have written is,
Code:
"EXECIO 1 DISKR INFILE"                               
PARSE PULL INPUT                                     
/*SAY INPUT*/                                         
VAR1 = CHARIN ( INPUT, 1, 20)                         
SAY VAR1                                             
"EXECIO 0 DISKR INFILE(FINIS"



Coded - Anuj
Back to top
View user's profile Send private message
prino
Warnings : 1

Senior Member


Joined: 07 Feb 2009
Posts: 1263
Location: Vilnius, Lithuania

PostPosted: Tue Aug 07, 2012 11:59 am
Reply with quote

I'd suggest you start reading a manual for REXX on z/OS. CHARIN is not doing what you want it to do, and next to that, it's rarely available on z/OS systems.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Aug 07, 2012 3:13 pm
Reply with quote

I agree with Robert (prino), CHARIN/LINEIN/CHAROUT/LINEOUT are for PC and EXECIO for mainframe.

This is your first post on the Forum, so tell us if you are phrasing a probelm from zOS world or from PC?
Back to top
View user's profile Send private message
pj2810

New User


Joined: 07 Aug 2012
Posts: 4
Location: india

PostPosted: Tue Aug 07, 2012 3:47 pm
Reply with quote

This is problem a from zOS
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 199
Location: UK

PostPosted: Tue Aug 07, 2012 4:18 pm
Reply with quote

Well, I think that's your probelm then. According to the manual there is no such command as CHARIN.

What makes you think there is?
Back to top
View user's profile Send private message
pj2810

New User


Joined: 07 Aug 2012
Posts: 4
Location: india

PostPosted: Tue Aug 07, 2012 4:57 pm
Reply with quote

Many Thanks for your answers ... Quite helpful icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Aug 07, 2012 5:26 pm
Reply with quote

pj2810 wrote:
This is problem a from zOS
There is no "end scope terminator" in your sentence (too much COBOL these days), so I'll assume your statement is not yet complete -- why do you say it's from zOS, just because you've used something applicable to PC in the realm of native zOS? icon_eek.gif

As David says, this is your problem then.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 708
Location: Whitby, ON, Canada

PostPosted: Tue Aug 07, 2012 5:33 pm
Reply with quote

Stream I/O (CHARIN et al) is a function package that can be installed on z/OS. It is not part of the native TSO/Rexx support.

See publib.boulder.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.rexa100%2Fh1981605210.htm
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Aug 07, 2012 7:30 pm
Reply with quote

Thanks Don, appreciate the URL.

I surely did miss that link in my searches.... icon_redface.gif

Regards,
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Aug 08, 2012 2:39 am
Reply with quote

pj2810 wrote:
Hi,
I am trying to write REXX program using CHARIN function.
But getting following error
Code:
    14 +++ VAR1 = CHARIN ( INPUT, 1, 20)                     
Error running CHARIN1, line 14: Unexpected "," or ")"       
Code that i have written is,
Code:
"EXECIO 1 DISKR INFILE"                               
PARSE PULL INPUT                                     
/*SAY INPUT*/                                         
VAR1 = CHARIN ( INPUT, 1, 20)                         
SAY VAR1                                             
"EXECIO 0 DISKR INFILE(FINIS"

The issue of whether or not CHARIN is available on your system is not relevant to the error you're getting. In z/OS (at least) Rexx, a function name must be immediately followed by the opening parenthesis. Change your code to
Code:
"EXECIO 1 DISKR INFILE"                               
PARSE PULL INPUT                                     
/*SAY INPUT*/                                         
VAR1 = CHARIN(INPUT,1,20)                         
SAY VAR1                                             
"EXECIO 0 DISKR INFILE(FINIS"
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 -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts Tilde Characters Changing to COLONs i... CLIST & REXX 5
No new posts DSN REXX VARBINARY inserts CLIST & REXX 4
No new posts How to modify file content using REXX CLIST & REXX 3
No new posts Same command as on commandline in REX... TSO/ISPF 6
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
Search our Forums:

Back to Top