Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OMVS Command in JCL

209 views
Skip to first unread message

venkat kulkarni

unread,
Aug 15, 2017, 1:32:46 AM8/15/17
to
Hello,

I have requirement to run omvs command using batch job but not sure, where
i am making mistake.

//IBMUSEER JOB 654,VENKAT,CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSPUT=*
//SYSTSIN DD *

OGET '/u/venkat/test_01.txt' 'IBM06.DATA.TEST1'
OGET '/u/venkat/test_02.txt' 'IBM06.DATA.TEST2'


OSHELL
{
echo '!rm -r /u/venkat/test_01.txt' ; +
echo '!rm -r /u/venkat/test_01.txt' ; }

/*

but this jcl doesn't seems to be removing the file from the location,we
mentioned but OGET command works well.

Please suggest, if any changes in this JCL is required to make this full
process work.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@listserv.ua.edu with the message: INFO IBM-MAIN

Elardus Engelbrecht

unread,
Aug 15, 2017, 3:21:30 AM8/15/17
to
venkat kulkarni wrote:

>but this jcl doesn't seems to be removing the file from the location,we mentioned but OGET command works well.

How so? Please post any message(s) in full why not.


>Please suggest, if any changes in this JCL is required to make this full process work.

Please post any message(s) in full.

Groete / Greetings
Elardus Engelbrecht

John McKown

unread,
Aug 15, 2017, 8:48:48 AM8/15/17
to
On Tue, Aug 15, 2017 at 12:32 AM, venkat kulkarni <
venkatku...@gmail.com> wrote:

> Hello,
>
> I have requirement to run omvs command using batch job but not sure, where
> i am making mistake.
>
> //IBMUSEER JOB 654,VENKAT,CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
> //STEP1 EXEC PGM=IKJEFT01
> //SYSTSPRT DD SYSOUT=*
> //SYSPRINT DD SYSPUT=*
> //SYSTSIN DD *
>
> OGET '/u/venkat/test_01.txt' 'IBM06.DATA.TEST1'
> OGET '/u/venkat/test_02.txt' 'IBM06.DATA.TEST2'
>
>
> ​​
> OSHELL
> {
> echo '!rm -r /u/venkat/test_01.txt' ; +
> ​​
> echo '!rm -r /u/venkat/test_01.txt' ; }
>
> /*
>
> but this jcl doesn't seems to be removing the file from the location,we
> mentioned but OGET command works well.
>
> Please suggest, if any changes in this JCL is required to make this full
> process work.
>
>
​Well, first off, the OSHELL has the wrong syntax as show in the above
message. It should look like:


OSHELL +
{ +
echo '!rm -r /u/venkat/test_01.txt' ; +


echo '!rm -r /u/venkat/test_01.txt' ; }

​Second, why do you expect an "echo" command to remove files? You have
simply said to "echo" the "!rm ..." lines to stdout. Which is what happened
in my test. The ! in the string does NOT mean "execute the following
string". You should have something like:

OSHELL +
{ +
rm -r /u/venkat/test_01.txt ; +


rm -r /u/venkat/test_01.txt ; }

​or, even simpler:

OSHELL +
rm -r /u/venkat/test_01.txt ; +


rm -r /u/venkat/test_01.txt ;


​Lastly, why are you doing two "rm" commands for the same file?​


--
If you look around the poker table & don't see an obvious sucker, it's you.

Maranatha! <><
John McKown

Paul Gilmartin

unread,
Aug 15, 2017, 11:08:45 AM8/15/17
to
On Tue, 15 Aug 2017 08:32:34 +0300, venkat kulkarni wrote:
>
>OSHELL
> {
> echo '!rm -r /u/venkat/test_01.txt' ; +
> echo '!rm -r /u/venkat/test_01.txt' ; }
>
>Please suggest, if any changes in this JCL is required to make this full
>process work.
>
I'd suggest as an easier alternative:
//STEP EXEC PGM=IEFB14
//FILE DD PATHOPTS=ORDWR,PATHDISP=DELETE,
// PATH='/u/venkat/test_01.txt'

-- gil

Paul Gilmartin

unread,
Aug 15, 2017, 11:26:26 AM8/15/17
to
On Tue, 15 Aug 2017 08:32:34 +0300, venkat kulkarni wrote:
>
>OSHELL
> {
> echo '!rm -r /u/venkat/test_01.txt' ; +
> echo '!rm -r /u/venkat/test_01.txt' ; }
>
>Please suggest, if any changes in this JCL is required to make this full
>process work.
>
Or, the alternative (untested):

//STEP EXEC PGM=BPXBATCH, PARMDD=CMDS
//STDOUT DD SYSOUT=(,)
//STDERR DD SYSOUT=(,)
//PARMDD DD *
set -x;
cp "//'IBM06.DATA.TEST1''" /u/venkat/test_01.txt;
cp "//'IBM06.DATA.TEST2''" /u/venkat/test_02.txt;
rm -r /u/venkat/test_01.txt' ;
rm -r /u/venkat/test_02.txt' ;
//

John McKown

unread,
Aug 15, 2017, 11:31:51 AM8/15/17
to
On Tue, Aug 15, 2017 at 10:26 AM, Paul Gilmartin <
0000000433f0781...@listserv.ua.edu> wrote:

> On Tue, 15 Aug 2017 08:32:34 +0300, venkat kulkarni wrote:
> >
> >OSHELL
> > {
> > echo '!rm -r /u/venkat/test_01.txt' ; +
> > echo '!rm -r /u/venkat/test_01.txt' ; }
> >
> >Please suggest, if any changes in this JCL is required to make this full
> >process work.
> >
> Or, the alternative (untested):
>
> //STEP EXEC PGM=BPXBATCH, PARMDD=CMDS
> //STDOUT DD SYSOUT=(,)
> //STDERR DD SYSOUT=(,)
> //PARMDD DD *
> set -x;
> cp "//'IBM06.DATA.TEST1''" /u/venkat/test_01.txt;
> cp "//'IBM06.DATA.TEST2''" /u/venkat/test_02.txt;
> rm -r /u/venkat/test_01.txt' ;
> rm -r /u/venkat/test_02.txt' ;
> //
>
> -- gil
>
>
​Personally, I prefer your method for "UNIX only" work. But the IKJEFT01
method may be "better" if one is doing other TSO work in the same input
stream.​

--
If you look around the poker table & don't see an obvious sucker, it's you.

Maranatha! <><
John McKown

Carmen Vitullo

unread,
Aug 15, 2017, 11:32:33 AM8/15/17
to
I just use IKJEFT01 but the caveat is you need to BPX rexx in SYSEXEC
this works well for me, you can use any shell command




//SYSA EXEC PGM=IKJEFT1B,REGION=0K
//SYSTSPRT DD SYSOUT=*
//SYSEXEC DD DSN=SYS1.SBPXEXEC,DISP=SHR
//SYSTSIN DD *
PROF MSGID WTPMSG
oshell cd /TEMPA
MKDIR '/TEMPA/SYSA' MODE(7,7,7)
MKDIR '/TEMPA/PLEX1' MODE(7,7,7)
MKDIR '/TEMPA/PLEX1/ftp' MODE(7,7,7)
MKDIR '/TEMPA/SYSA/usr' MODE(7,7,5)
MKDIR '/TEMPA/SYSA/usr/local' MODE(7,7,5)
MKDIR '/TEMPA/SYSA/usr/local/.ssh' MODE(7,7,5)
........................................................................................


oshell ln -s /SYSA/usr/local/.ssh /TEMPA/.ssh
oshell ln -s /SYSA/usr/local/abinitio /TEMPA/abinitio
oshell ln -s /SYSA/usr/local/ahin /TEMPA/ahin
oshell ln -s /SYSA/usr/local/ahinarch /TEMPA/ahinarch
oshell ln -s /SYSA/usr/local/build /TEMPA/build
oshell ln -s /SYSA/usr/local/ca-ops /TEMPA/ca-ops
oshell ln -s /SYSA/usr/local/cai /TEMPA/cai
oshell ln -s /PLEX1/usr/local/ftp /TEMPA/ftp
oshell ln -s /SYSA/usr/local/grp /TEMPA/grp
oshell ln -s /PLEX1/usr/local/HIS /TEMPA/HIS
oshell ln -s /SYSA/usr/local/IDIGMAIN /TEMPA/IDIGMAIN
oshell ln -s /SYSA/usr/local/incoming /TEMPA/incoming
oshell ln -s /SYSA/usr/local/incoming_dev /TEMPA/incoming_d
oshell ln -s /SYSA/usr/local/nfs /TEMPA/nfs
----- Original Message -----

Nims,Alva John , Al

unread,
Aug 15, 2017, 12:39:18 PM8/15/17
to
Gil,

Will this still work if the file does not exist when the IEFBR14 step is run?

Al Nims
Systems Admin/Programmer 3
UFIT
University of Florida
(352) 273-1298

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-...@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin
Sent: Tuesday, August 15, 2017 11:08 AM
To: IBM-...@LISTSERV.UA.EDU
Subject: Re: OMVS Command in JCL

John McKown

unread,
Aug 15, 2017, 12:47:16 PM8/15/17
to
On Tue, Aug 15, 2017 at 11:39 AM, Nims,Alva John (Al) <ajn...@ufl.edu>
wrote:

> Gil,
>
> Will this still work if the file does not exist when the IEFBR14 step is
> run?
>

​Probably should have the OCREAT in the PATHOPTS. I.e.
​​
//STEP EXEC PGM=IEFB14
//FILE DD PATHOPTS=
​(​
OCREAT,RDWR),PATHDISP=DELETE,
// PATH='/u/venkat/test_01.txt'
--
If you look around the poker table & don't see an obvious sucker, it's you.

Maranatha! <><
John McKown

venkat kulkarni

unread,
Aug 22, 2017, 5:16:18 AM8/22/17
to
Thanks for your help. I am able to run omvs command using JCL now.

Regards
Venkat

On Tue, Aug 15, 2017 at 7:47 PM, John McKown <john.arch...@gmail.com>
wrote:
0 new messages