Suppose that the log file defaultserverstderr.log should be deleted after every week. The following CL programs can be scheduled to run in batch every week.
To demonstrate the use of the unlink and rename APIs, here's a sample program that can be used to either rename or delete a stream file. What it does is ask for two parameters. The first is the current pathname of an IFS object. The second parameter is either the new pathname, or the special value.DELETE. If.DELETE is specified, our program will bring up a window asking for confirmation before actually calling the unlink API. Here's the command source: CMD PROMPT('Rename or Delete an IFS object') PARM KWD(OLD) TYPE(.CHAR) LEN(640) + PROMPT('Original (OLD) Object Name') PARM KWD(NEW) TYPE(.CHAR) LEN(640) + CHOICE('Character or.DELETE') + PROMPT('New Object Name or.DELETE') Here's the DDS for the Window that it pops up: A DSPSIZ(24 80.DS3) A R DUMMYREC A ASSUME A 1 2' ' A R RENDELS1 A WINDOW(9 30 6 20) A 2 1'File:' A SCFILE 14 O 2 7 A 3 1'Size:' A SCSIZE 10Y 0O 3 7EDTCDE(L) A 5 1'Really? A SCREALLY 1 I 5 20 Here's the RPG code that makes it all work:.
CH3RENDEL: Example of deleting/renaming objects in the IFS. (From Chap 3). To compile:. CRTBNDRPG CH3RENDEL SRCFILE(xxx/QRPGLESRC) DBGVIEW(.LIST). H DFTACTGRP(.NO) ACTGRP(.NEW) BNDDIR('QC2LE') FCH3RENDELSCF E WORKSTN D/copy IFSEBOOK/QRPGLESRC,IFSIOH D/copy IFSEBOOK/QRPGLESRC,ERRNOH D upper C 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' D lower C 'abcdefghijklmnopqrstuvwxyz' D Path S 640A D NewPath S 640A D LowerNewPath S 640A D MyStat S like(statds) D Len S 10I 0 D Pos S 10I 0.
Warning: call this program from the command. If you call. it directly, because 'Path' is larger than 32 bytes. See. C.entry plist c parm Path c parm NewPath c upper:lower xlate NewPath LowerNewPath c if LowerNewPath = '.delete' c exsr KillIt c else c exsr NewIdentity c endif c eval.inlr =.on C. C.
Kill off the file (Delete it from the IFS) C. CSR KillIt begsr C.- C. Retrieve current file stats: c if stat(%trimr(path):%addr(mystat)) 0 c if%subst(path:Pos:1) = '/' c leave c endif c eval Pos = Pos -1 c enddo c if Pos.
Is it possible that your current directory is something other than the root directory? If so maybe it's looking in your current directory for that path & file. Before trying to RMVLNK or other function just for grins and giggles do CD '/' and see if that changes anything. Thanks, Tommy Holden From: Mark Walter To: Midrange Systems Technical Discussion Date: 01:48 PM Subject: RE: Can't delete files in the IFS Sent by: midrange-l-bounces@xxxxxxxxxxxx I've had luck with stuff like this using qshell.
Mark Walter Business to Business Data Integration Specialist Certified IBM System i Specialist Paragon Consulting Services, Inc mwalter@xxxxxxxxxxxxxxx 717-764-7909 ext. 126 -Original Message- From: midrange-l-bounces@xxxxxxxxxxxx mailto:midrange-l-bounces@xxxxxxxxxxxx On Behalf Of fbocch2595@xxxxxxx Sent: Wednesday, June 10, 2009 2:28 PM To: midrange-l@xxxxxxxxxxxx Subject: Can't delete files in the IFS Hi Folks,?I think I'm gonna stump the band on this one.?? I'm unable to delete certain files from the IFS.? IBM support has no way to delete them.?
These objects were created by our HA replication software and the HA vendor doesn't know how to remove them either.? IBM says they have a hidden character.??? I get msg CPFA0A9 whether I use the 4 option from the display or rmvlnk (as shown below).?? I tried the IFSTOOL DLTFIFS but that also gets me?CPFA0A9.? Using EDTF '/' I was able to use?option 4 which seemed to?delete the files and I thought that was successful EDTF / doesn't display these objects anymore?but?when I use?WRKLNK '/' I still see the files (they're listed at the bottom).??? When I try to delete via?qsh rm, here's what I get;???
$???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? rm '/test/rpts051809/H04CLMPF10673127.TXT'???????????????????????????????????????????????????????????????????????????????? Rm: 001-2103 Error found getting information for file or directory /test/rpts051809/H04CLMPF10673127.TXT. No such path or??
So, I ask you folks, does anyone know how I might b/able to remove these objects????????????? Candlemass psalms for the dead free. Thanks, Frank???????????????????????????
Find great deals on eBay for biology mader 11. Shop with confidence. (11.0K) Biology (Mader), 10th Edition. AP* Biology Free Response Questions; Presentation Tools; Fostering Active Learning; Forensic Science Activities. Mader biology chapter 11. Amazon.com: biology mader 10th. Interesting Finds Updated Daily. Mader - Human Biology (10th Edition) (2007-11-16) [Textbook Binding] Nov 16, 2007. AP Biology (Mader), 11th Edition. Textbook Resources. Biology Prep; Writing Lab Reports and Papers; Spanish.
Work with Object Links????????????????????????????????????????????????????????????????????????????????????????????????????????????Directory?.:?? Object link??????????Type???????????? /test/rpts051809 ?? /test/rpts051809 ?? /test/rpts051909 ?? /test/rpts051909 ??
Carenado bonanza a36 manual lymphatic drainage. /test/rpts051909 ?? /test/rpts051909 ?? /test/rpts051909 ?? DIR????????????????????????????????????????????????Object not found.? Object is /test/rpts051809/H04CLMPF10673127.TXT.???????????????????????????? Additional Message Information????????????????????????????????????????????????????????????????????????????????????????????????????????Message ID.:?? 40?????????Message type.:??
Diagnostic??????????????????????????????????????????Date sent?.:?? Time sent?.:?? Object not found.? Object is???????????????????????????????? Object /test/rpts051809/H04CLMPF10673127.TXT, or a???
Directory in the object path, could not be found, or its type cannot be??????? Resolved by this function.???????????????????????????????????????????????????Recovery?.:?? Correct the name or specify an object of the correct type.?? To determine if the object exists, use the?
Work with Object Links (WRKLNK)??? If the name exists, check the type of the object. If the name???????? Contains symbolic link objects, ensure the path names they resolve to exist.??? Retry the operation.???????????????????????????????????????????????????????????????????????Any help appreciated, Frank - This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives.
I have been asked to create an automatic procedure which cleans out (ie delete) files older than 6 months. Transaction files keep coming into the system, and after having been processed (read) they are moved to an IFS directory 'archive'.
We now have more than 90.000 files from last 26 months. I have considered various solutions like 'ls' to a file, and then read via pgm and execute delete, BUT something tells me that there is a better solution. I would like to do the job from a CL-pgm using STRQSH with some 'rm' command, but I got stuck in my investigations.
Pls give me some thoughts on how to do this smart. Software/Hardware used: system i, v6r4. After a lot of investigation, I got created the one-statement-solution to my question.
Since no one amongst you seems to know what I found out, I'll teach you the trick. If you insert the directory-path of the directory to search/delete old files into the following CL-statement the command will do the job of deleting fils older than 180 days. STRQSH CMD('find mydirpath -type f -mtime +180 xargs rm') In short: the QSHELL command 'find' creates an internal list of files older than 180 days; - the lst is 'piped' (passed) to the delete-function ('xargs rm'). Of course the 180-number may be changed to other values.
Yet another proof tht we are working on a great machine - it also runs unix-commands:-) PS: Some may prefer two lines of code: CD mydirpath STRQSH CMD('find.type f -mtime +180 xargs rm') best rgds DanF. Miker, I tried to copy/paste your statement onto a 5250 commandline; the beginning and ending apostrophes were displayed as a dark rectangle; - this made me wonder about codepage!!! Well, having replaced your directory ('/MRTEST') with a directory that exists on my box, and replaced the two errorneous rectangle characters (x'1A') with apostrophes, and removed the piping of data (' xargs rm'), the statement looked like this: STRQSH CMD('find /wpa/ARKIV/WPA2ERP -type f -mtime +30') I pressed the Enter key, and the stement was executed without errors. Without the piping of the data, the data is simply displayed on screen. I have no exact answer to your question, but maybe the following could be investigated: 1.
Os400 release level and ptf-level. Is your apostrophs the right character?? Study this carefully: Your statement copy/pasted: STRQSH CMD(’find /MRTEST -type f -mtime +30 xargs rm’).and the same code with an extra apostroph addet to the last apostroph of yours: STRQSH CMD(’find /MRTEST -type f -mtime +30 xargs rm’') I copy/pasted directly in browserenvironment.
The Ifs In Life
Look carefully, - your apostroph and the one I entered are not the same. How did you enter the statements? - on a PC with copy/paste to 5250. Try keying in the statement directly on a 5250 commandline.
Pls report back, and I'll try to help you.