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
 

 

UNIX commands using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: UNIX commands using REXX
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: 7931
Location: Bellevue, IA

PostPosted: Tue Feb 09, 2010 4:13 pm    Post subject:
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    Post subject: Reply to: UNIX commands using REXX
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: 7931
Location: Bellevue, IA

PostPosted: Tue Feb 09, 2010 8:59 pm    Post subject:
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    Post subject: Reply to: UNIX commands using REXX
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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