View previous topic :: View next topic
|
Author |
Message |
atulbaviskar
New User
Joined: 08 May 2008 Posts: 8 Location: Mumbai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
Atul,
Check your company email... |
|
Back to top |
|
|
atulbaviskar
New User
Joined: 08 May 2008 Posts: 8 Location: Mumbai, India
|
|
|
|
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 |
|
|
atulbaviskar
New User
Joined: 08 May 2008 Posts: 8 Location: Mumbai, India
|
|
|
|
Here..the folder My documents is just for rerrenced, the real folder name would be of Prod server. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Use the Windows Scheduler. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
or CRON if it's installed |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
is this one a company directive or a personal whim ??? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
@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 |
|
|
atulbaviskar
New User
Joined: 08 May 2008 Posts: 8 Location: Mumbai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
atulbaviskar
New User
Joined: 08 May 2008 Posts: 8 Location: Mumbai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
If this was not for production, my advice would be to use the ISPF Workstation Agent. You could use the "WSCMD" ISPF service to execute your bat file once a connection is established to your workstation.
I doubt that your Operations department would consider this approach to be robust enough for production however. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why does someone believe this remote file cleanup should involve the mainframe?
Suggest you consider working with your pc/network support people to implement a "clean-up" process that does Not involve the mainframe. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
dick scherrer wrote: |
Hello,
Why does someone believe this remote file cleanup should involve the mainframe? |
Because the LUW analysts can't/won't do it
We have a process that sounds identical to what you are looking for, Atul-kun (which we wrote because the LUW analysts couldn't do it). If I have time I'll research it. |
|
Back to top |
|
|
|