Hi,
I have a Unix directory where I get number of files . out of them I need to get the names of files which are modified in current month I.e. today-30 days and that should exclude the files which are currently in use.
I am absolutely running out of ideas as I have less/bill experience on unix .
Any help is really really appreciated
lsof lslk are OS commands that are doing a list of files that the OS sees as open/locked. (Xcmd needed)
15 Linux lsof Command Examples (Identify Open Files) Finding and removing locked files on a GNU/Linux system | unix-heaven.org It is requiring to understand what is happening
1/ How are seeing that they are modified by the files date-stamp or by some checksum method.
2/ files being in use. That is more difficult one by its definition.
technically it is about locks SAS(R) 9.3 Companion for UNIX Environments but locking is not mandatory so you can miss those
logically it is about knowing who is using that data. In that case you should have some monitoring tool that answers that question. But as with locking you can miss that info.
What is available and what is the requirement?
There are a number of external file functions that will let you get the names of files in a directory and then get properties such as modified date. Look for: Dopen , Dread, Dsname, Open, Foptname, Foptnum, and Finfo functions.
It is OS command thing.
I would use OS command to get these result and redirect it into another file , after that using sas code to get what I want.
or use Filename statement + PIPE .
lsof lslk are OS commands that are doing a list of files that the OS sees as open/locked. (Xcmd needed)
15 Linux lsof Command Examples (Identify Open Files) Finding and removing locked files on a GNU/Linux system | unix-heaven.org It is requiring to understand what is happening
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.