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
 

 

How to execute a .bat file using JCL?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
atulbaviskar

New User


Joined: 08 May 2008
Posts: 6
Location: Mumbai, India

PostPosted: Thu Apr 04, 2013 5:42 pm    Post subject: How to execute a .bat file using JCL?
Reply with quote

In my shop, i have to delete .txt files older than 7 days say kept in Perticulart folder (My Documents) and various other criteria, I used MS-DOS command and kept all dos commands in .txt and saved it as .bat file. It works fine when run standalone..i want to automate this process to include in my shop batch cycle. Is there any way i can achieve this any sample JCL?

Appreciate your help. Thanks.

Atul
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Apr 04, 2013 5:44 pm    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

Quote:
.i want to automate this process to include in my shop batch cycle. Is there any way i can achieve this any sample JCL?


how do You plan to have zOS and windoze talk to each other ???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Apr 04, 2013 5:51 pm    Post subject:
Reply with quote

To add to enrico's comment, if this is on your desktop and not a server, then you have at least two issues:
1) desktops don't normally run server software to let them be connected to from a mainframe, and
2) desktops don't normally get fixed IP addresses so if your mainframe is supposed to connect to it, how does the mainframe determine the IP address to use?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Apr 04, 2013 6:00 pm    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

if Your organization wants to enforce rules to handle the data stored on the workstations
the proper approach would be to investigate the use of a DISTRIBUTED STORAGE MANAGER

not to endorse anything but just to quote
IBM Tivoli Storage Manager is one
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Thu Apr 04, 2013 6:02 pm    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

Hopefully you are not talking about your own PC, as that can't be part of Production.

Somewhere you must have some network/PC support people. Talk to them. If you already have files coming from the Mainframe which you now want to do "housekeeping" on, then you have to find out how it is being done, and what are reasonable options for automatically managing the files once they are there.

I'd not put them in "MyDocuments" anyway. Even if not run as a "PC" per se, there's too much danger of someone saying "MyDocuments on an unattended machine? It's OK to get rid of those...". If run as a PC, the "user" could more easily idly delete files they didn't "recognise" but which someone wanted.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Thu Apr 04, 2013 8:37 pm    Post subject:
Reply with quote

Atul,

Check your company email...
Back to top
View user's profile Send private message
atulbaviskar

New User


Joined: 08 May 2008
Posts: 6
Location: Mumbai, India

PostPosted: Fri Apr 05, 2013 10:21 am    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

Actually, my requirement is to delete the files older than 7 days kept at production folder. Executing a .bat files using below MS-DOS command would be manual process -

FORFILES /P U:\FILES /S /M DCM*.txt /D -7 /C "cmd /c del @file /Q"

I want to automate this process to include in daily batch cycle.
Back to top
View user's profile Send private message
atulbaviskar

New User


Joined: 08 May 2008
Posts: 6
Location: Mumbai, India

PostPosted: Fri Apr 05, 2013 10:50 am    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

Here..the folder My documents is just for rerrenced, the real folder name would be of Prod server.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 05, 2013 11:28 am    Post subject:
Reply with quote

Use the Windows Scheduler.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 05, 2013 12:08 pm    Post subject:
Reply with quote

or CRON if it's installed
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 05, 2013 12:10 pm    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

is this one a company directive or a personal whim ???
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 05, 2013 1:27 pm    Post subject: Re: Reply to: How to execute a .bat file using JCL?
Reply with quote

Quote:
is this one a company directive or a personal whim ???


atulbaviskar wrote:
Actually, my requirement is to delete the files older than 7 days kept at production folder.


But does that really matter?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 05, 2013 1:33 pm    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

it does make a difference IMO

if it is a personal whim
then using JCL is inappropriate

if it is a company directive
I already told my opinion about the proper approach using a distributed storage manager


but really the TS just cared about the lowly technicalities
without caring about the overall logic

for example
is the PC a server or a personal workstation ???
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Apr 05, 2013 2:56 pm    Post subject:
Reply with quote

@TS
If you want to delete the files on production server after checking the mainframe batch cycle completion, then I would try using windows Scheduler as Peter said.

Here is a crude approach assuming u have FTP connection from prod server to mainframe.

1. make mainframe batch cycle to create a dummy tracking file on mainframe with date once batch cycle is successfully over.
2. on the windows production server side, make windows scheduler to trigger a FTP GET of the tracking file created by batch cycle.
3. check the tracking file if it has the desired date and kick off the batch file to delete 7 days old files.
Back to top
View user's profile Send private message
atulbaviskar

New User


Joined: 08 May 2008
Posts: 6
Location: Mumbai, India

PostPosted: Fri Apr 05, 2013 4:28 pm    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

Hi Vasanthz,

It is company directive.
As per Pt. 3 again would be a manual process. My shop wants it to be automate and run in every batch cycle.

In my shop a proc say PLACE run thru a job and using ICETOOL keep the DATA in path that was passed from job. The path is prod folder.

//STPC100 EXEC PGM=ICETOOL,ACCT='C=0'
//*------------------------------------------------------*
//* COPY FILE DATA *
//*------------------------------------------------------*
//IN01 DD DSN=TEMP.DATA.FILE,DISP=SHR
//OT01 DD PATH='&PATH.DATAFILE.TXT',
// PATHDISP=(KEEP,DELETE),
// PATHMODE=(SIRWXG,SIRWXU,SIRWXO),
// PATHOPTS=(OCREAT,ORDWR,OTRUNC)

This is a daily job and the folder is dumped with reports, there is no date with file name, the MS-DOS commands that I have mentioned in previous threads checks for modified date and delete the files older than 7 days.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 05, 2013 4:37 pm    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

things get more and more confusing
what are YOU talking about...

<something> stored on a PC
or <something> stored on a zOS UNIX SYSTEM SERVICES Filesystem ???
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Apr 05, 2013 4:52 pm    Post subject:
Reply with quote

Quote:
As per Pt. 3 again would be a manual process.

Nope, write a program to do the checking, dont do it manually.

Quote:
<something> stored on a PC
or <something> stored on a zOS UNIX SYSTEM SERVICES Filesystem ???

@TS you need to explain your answer to this question
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Fri Apr 05, 2013 5:12 pm    Post subject:
Reply with quote

atulbaviskar: so far you have explained NOTHING about what you are wanting to do, and you are ignoring questions posed to you. Merely repeating the same lines is not answering questions; find a different way to explain what you are wanting to accomplish. Unless and untill you answer -- completely and fully -- these questions, there is no chance that you will get help on this forum:

1. Are you talking about Windows or Unix?
2. Are you talking about a server or a desktop machine?
3. If Windows, why will Windows Scheduler not do what you want?
4. If Unix, why will CRON not do what you want?
5. How are you planning on connecting the mainframe to the remote machine -- FTP? REXEC? something else you haven't explained?
Back to top
View user's profile Send private message
atulbaviskar

New User


Joined: 08 May 2008
Posts: 6
Location: Mumbai, India

PostPosted: Mon Apr 08, 2013 11:41 am    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

1. Windows
2. Server
3. I don't have access to windows scheduler
4. No Unix
5. That's what i am not sure off, how would i connect but is there way to achieve this.

My requirement is to delete the report files oldar than 7 days placed in Server folder.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Apr 08, 2013 11:58 am    Post subject: Reply to: How to execute a .bat file using JCL?
Reply with quote

Quote:
That's what i am not sure off, how would i connect but is there way to achieve this.


Pulling info from You is like pulling teeth

lets' s start from the beginning

1) how do the files originate ?
1a) locally
1b) downloaded/transmitted from them MF

for case 1a
what kind of connectivity is in place between the MF and the windoze system

for case 1b
what software is used to download/ transmit them

why haven' t You spoken yet to ...
network support, for connectivity and file transfer tools in place ?
windows server support to ask them to do it using windows tools ?
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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