View previous topic :: View next topic
|
Author |
Message |
depakjan
New User
Joined: 14 Apr 2008 Posts: 7 Location: chennai
|
|
|
|
Hi,
I am trying to execute some unix commend through mainframes, i searched the forums and found out about BPXBATCH, when i tried executing a simple JCL i get this error FSUM1004 Cannot change to directory </u/userid>
Code: |
//******** JOB (D3),'UNIX',
// MSGCLASS=A,NOTIFY=&SYSUID,REGION=0M
//*
//BPXBATCH EXEC PGM=BPXBATCH
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDPARM DD *
SH echo "This is my first test"; |
What is wrong with my script?.... also if i am executing a shell script placed in an UNIX server how do i do it using BPXBATCH? , what parameters do i need, like do i need the IP of the UNIX server to make a connection and then specifiy the directory structure where my script is placed?[/code] |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Problem 1: assuming your site uses RACF, contact your site security group and verify that your user id has an OMVS segment with valid program and home entries. (TOP SECRET and ACF/2 have similar functions but I don't use them so don't know their terminology).
Problem 2: contact your site support group and verify that your home directory /u/userid exists or have it created (automount works well).
Problem 3: Unix commands are case-sensitive. You entering SH means you are attempting to execute a program called SH in your home directory -- you are not running a shell command. |
|
Back to top |
|
|
depakjan
New User
Joined: 14 Apr 2008 Posts: 7 Location: chennai
|
|
|
|
Thanks robert, your suggestions were very usefull, now i have some problem now, executing this code gives me this error 'FSUM1004 Cannot change to directory </u/userid>'
Code: |
//NBK6CSTA JOB (NDW3),'UNIX',
// MSGCLASS=A,NOTIFY=&SYSUID,REGION=0M
//*
//JS0010 EXEC PGM=BPXBATCH
//*
//STDIN DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDPARM DD *
sh echo mkdir ded |
so i chceked whether my directory is present with this code
Code: |
//NBK6CSTA JOB (NDW3),'UNIX',
// MSGCLASS=A,NOTIFY=&SYSUID,REGION=0M
//*
//JS0010 EXEC PGM=BPXBATCH
//*
//STDIN DD SYSOUT=*
//STDOUT DD SYSOUT=*
//STDPARM DD *
sh echo $HOME |
the output returns /u/userid .. so my home directory is present.. then why am i getting this error... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Try
Code: |
sh echo mkdir /u/userid/ded |
Batch jobs do not inherit your environment even when executing under your TSO user id, so you have to provide the full path name. |
|
Back to top |
|
|
eddychanst
New User
Joined: 04 Jan 2008 Posts: 1 Location: Ontario
|
|
|
|
use PGM=BPXBATCH,PARM='sh echo $HOME' |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
eddychanst, you're only 3 weeks shy of replying to an issue inactive for a year.
Also, PARM= and //STDPARM work the same for BPXBATCH. |
|
Back to top |
|
|
|