MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Connecting to Unix - no output

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
southskies
Beginner


Joined: 14 Jul 2008
Posts: 9
Topics: 4

PostPosted: Fri Jul 24, 2009 12:29 am    Post subject: Connecting to Unix - no output Reply with quote

Hi,

I'm trying to learn more abount the Unix function on the mainframe.

I've got a very simple job.
Code:

//STEP02   EXEC PGM=BPXBATCH,REGION=0M         
//SYSOUT   DD SYSOUT=*                         
//STDOUT   DD SYSOUT=*                         
//STDERR   DD SYSOUT=*                         
//STDIN    DD *                               
LS -1                                         

When I execute it, all I get is:
Code:

*---------------------------------------------------------------   
          /etc/profile 1.17 was executed                           
          Java version: J5.0                                       
*---------------------------------------------------------------   

Where does the output go?

Thanks!

Steve
Back to top
View user's profile Send private message
Ram
Beginner


Joined: 12 Jan 2004
Posts: 53
Topics: 12

PostPosted: Fri Jul 24, 2009 3:31 am    Post subject: Reply with quote

Steve,

The o/p of the unix command is directed to the dataset addressed by STDOUT dd name. Depending on the msgclass settings, the o/p could be lying in the spool. If you intend to copy the o/p to a HFS file then make these changes to your JCL ..

Code:
STDOUT   DD PATH='/home/dir1/stdout.txt',                                 
            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU 


Hope this answers your query.

Thanks,
Ram
Back to top
View user's profile Send private message
Ram
Beginner


Joined: 12 Jan 2004
Posts: 53
Topics: 12

PostPosted: Fri Jul 24, 2009 8:58 am    Post subject: Reply with quote

Is this 'LS -1 ' a typo ? try ls -l to list the directory contents.
Back to top
View user's profile Send private message
southskies
Beginner


Joined: 14 Jul 2008
Posts: 9
Topics: 4

PostPosted: Sun Jul 26, 2009 8:43 pm    Post subject: Still no output Reply with quote

Thanks Ram,

I was getting output coming through the STDOUT DDname, but all I got written out here was
*---------------------------------------------------------------
/etc/profile 1.17 was executed
Java version: J5.0
*---------------------------------------------------------------
I've fixed up the ls -1 to be ls -l. Still no output through.
Sad
Steve
Back to top
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Mon Jul 27, 2009 10:30 am    Post subject: Reply with quote

Probably doesn't matter but I typically use PARM= to pass input. Like this.

//BPX EXEC PGM=BPXBATCH,
// PARM='SH whatever command I want to issue'
Back to top
View user's profile Send private message
tcb
Beginner


Joined: 07 Nov 2005
Posts: 14
Topics: 1

PostPosted: Mon Jul 27, 2009 11:06 am    Post subject: Reply with quote

Hi, Steve.

You can try this:

Code:

//TSO      EXEC PGM=IKJEFT01
//SYSEXEC  DD DISP=SHR,DSN=SYS1.SBPXEXEC
//SYSTSPRT DD SYSOUT=*                 
//SYSTSIN  DD *                         
OSHELL ls -al
Back to top
View user's profile Send private message
Ram
Beginner


Joined: 12 Jan 2004
Posts: 53
Topics: 12

PostPosted: Mon Jul 27, 2009 11:14 am    Post subject: Reply with quote

Correct me if I am wrong, list directory command would list the default directory contents. In this case, the users home directory. If you dont have a home directory or access to it, you will not see any o/p from the ls command.
Back to top
View user's profile Send private message
tcb
Beginner


Joined: 07 Nov 2005
Posts: 14
Topics: 1

PostPosted: Mon Jul 27, 2009 11:50 am    Post subject: Reply with quote

Ram,

you will get

Code:

ls: FSUM6785 File or directory "/asdasd" is not found
Back to top
View user's profile Send private message
southskies
Beginner


Joined: 14 Jul 2008
Posts: 9
Topics: 4

PostPosted: Mon Jul 27, 2009 7:39 pm    Post subject: Reply with quote

Its a puzzle to me. I can go into native tso and type the oshell ls -al command and it works fine...

so why does batch work differently?
Back to top
View user's profile Send private message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Tue Jul 28, 2009 9:19 am    Post subject: Reply with quote

try LS -l 1>STDOUT 2>STDERR
Back to top
View user's profile Send private message
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Tue Jul 28, 2009 9:58 am    Post subject: Reply with quote

1. shell command should be input in PARM, using PARM='SH your unix command' or
Code:
//STDPARM DD *
SH your unix command

2. BPXBATCH run shell comand, should start with SH
3. STDIN must be z/OS UNIX file
Back to top
View user's profile Send private message
Ram
Beginner


Joined: 12 Jan 2004
Posts: 53
Topics: 12

PostPosted: Tue Jul 28, 2009 1:26 pm    Post subject: Reply with quote

Steve,

As videlord has correctly pointed out, commands supplied via STDIN should be stored in a HFS. Else pass the commands through parm option and you should be able to see the o/p in STDOUT.

Cheers,
Ram
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group