View previous topic :: View next topic
|
Author |
Message |
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dear Experts,
My Mainframe application sends plenty of files in .txt (Actual content) and .flg (supporting file, which contains the number of rows in the respective .txt file) to Downstream UNIX applicaitons
file-names looks like this
PROD.FILE1.txt and
PROD.FILE1.flg
My applicaiton used to move all the files (*.txt and *.flg) to OMVS region. Unix will pick these files (just copy) on daily basis and does the process on their end. But the file remains on OMVS region.
Problem is, since the file (*.txt and *.flg) remains on the OMVS region.
On the next day,
Assume, there is a delay on Mainframe batch and files are producing delayed, Unix application on the other hand, start their batch and picks yesterday's .txt and .flg files and continue the processing.
Please suggest the ways-out from this problem.
Is there any command to " Delete all *.txt and *.flg files on OMVS region " ?
Please suggest? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What should happen if "today" needs to run on the mainframe and "yesterday" has not yet been downloaded/processed by the UNIX system?
I believe there is more to this than deleting files. . . |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
What if there is a "problem" with the transmission that is not detected until AFTER you delete the original files?
Rather than take a chance, I would suggest that you set up a GDG with, perhaps, a maximum of 2 or 3 generations, and have a job that COPIES the current files into the +1 generation of the GDG, followed by an IEFBR14 step that DELETES the original files ( with a condition code based on the COPY step, just in case the COPY step fails ). If desired, the above steps could be added to the transfer job instead of being placed in a separate job. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dick,
Logically, this will not happen, that is why My applicaiton want to delete all .txt and .flg files on OMVS (belongs to yesterday's batch), today before starting the actual batch cycle and start transmitting the fresh list of files.
Even though there is any failure on Mainframe side, files will be delayed and at the worst fix will be provided by 12:00 Noon. and My application will normally deletes the files on next day.
Please correct me, If I'm wrong! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Logically, this will not happen |
Yes, i understand that this is not supposed to happen. But it will. . . And must be planned for so that data is not lost.
Quote: |
Even though there is any failure on Mainframe side |
There may also be situations where the non-mainframe process to download the data is not run for some reason.
Once upon a time (when i was also a AIX/HP-UX UNIX sysadmin/dba), the remove (rm) command was used to delete files. Been a while, but i suspect a "masked" rm command in OMVS will delete multiples. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
rm *.txt
rm *.flg
would be one way to use OMVS commands to remove the files. However, as Dick pointed out, production requirements sooner or later will mandate that those files be available after you've deleted them so you need to ensure they are recoverable in some way. Remember, something having one chance in 1000 of occurring means you'll have to deal with it every 3 years of daily production. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Dick and Robert,
For that,
I maintain a back-up of the Mainframe files on daily files,
Failres happen less frequently, and ( WE ) the developers will fix the problems manually and re-transfer the files to OMVS (and will be deleted manually after the .txt and .flg file consumed by unix applicaiton successfully. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi Robert,
I use the below control-card to transfer any mainframe file onto OMVS region.
ALLOCATE DDNAME(KPAYR) -
PATH('/u/users/my-userid/DlyFileSample.txt') -
PATHDISP(KEEP,DELETE) PATHMODE(SIRWXU) -
PATHOPTS(OCREAT,OWRONLY)
OCOPY INDD(INDSN) OUTDD(KPAYR) TEXT CONVERT((BPXFX311)) FROM1047
As you suggested,
I can use the commands by logging onto OMVS region and execute these rm commands.
But I want this should be performed using the job.
Please share if you have any sample code for this.
rm *.txt and
rm *.flg |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You may need to contact your site support group about the SYSPROC data set name, but one way would be (note you do have to use fully qualified file names)
Code: |
//TMP EXEC PGM=IKJEFT01,REGION=0M,
// DYNAMNBR=200
//SYSPROC DD DSN=SYS1.SBPXEXEC,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//STDOUT DD SYSOUT=*
//SYSTSIN DD *
oshell rm /u/users/my-userid/*.txt
oshell rm /u/users/my-userid/*.flg
/* |
or you could use BPXBATCH. |
|
Back to top |
|
|
|