Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To remove all files on OMVS Region

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Mar 08, 2010 8:24 pm    Post subject: To remove all files on OMVS Region
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Mar 08, 2010 8:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Mar 08, 2010 8:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Mon Mar 08, 2010 8:44 pm    Post subject: To delete all files on OMVS Region
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Mar 08, 2010 9:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Mon Mar 08, 2010 9:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Mar 09, 2010 10:40 am    Post subject:
Reply with quote

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
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Tue Mar 09, 2010 6:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Tue Mar 09, 2010 6:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us