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

UNIX commands using REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kbrahma

New User


Joined: 08 Oct 2007
Posts: 38
Location: Delhi

PostPosted: Tue Feb 09, 2010 1:24 pm
Reply with quote

Hi All,

I was wondering if we can pass UNIX commands using REXX. I want to go to a specific path and then create a .txt file there. The TSO command "allocate file(pathname) path('cd /abc/def/ghi/jk/test.txt')", helps me to write into the file only if it exists. It gives me the file not cataloged error if it does not exist.

So I basically want to use the following commands in my REXX program,
"cd /abc/def/ghi/jk/"
"touch test.txt"

Could anyone please help me on how to use these commands in my code?

Thanks in advance,
Kushal

P.S. I experimented with "Address UNIX" command which gives me a return code of +++ RC(-3) +++, without any additional information.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 09, 2010 4:13 pm
Reply with quote

You need to add PATHOPTS to your ALLOCATE command.
Back to top
View user's profile Send private message
kbrahma

New User


Joined: 08 Oct 2007
Posts: 38
Location: Delhi

PostPosted: Tue Feb 09, 2010 8:43 pm
Reply with quote

Thanks a lot for the replies guys. The PATHOPTS parameters did the trick and the file is created.

Thanks again for the help! icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 09, 2010 8:59 pm
Reply with quote

Glad to hear you got it resolved!
Back to top
View user's profile Send private message
kbrahma

New User


Joined: 08 Oct 2007
Posts: 38
Location: Delhi

PostPosted: Wed Feb 10, 2010 12:40 am
Reply with quote

Better than resolving the problem, I got a clearer picture into how the PATHOPTS, PATHMODS and PATHDISP work. The things which I would not have learned if I didn't know where to go.

I earlier saw them being used in a batch job, but didn't know we could use them in the TSO allocate command as well.

The code I am making is not a work requirement, but a learning project... So it feels good when you learn new stuff. :-)
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top