×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
" Not with CL"
Can you explain why you can't do this in CL?
-----Original Message-----
From: Patrik Schindler [mailto:poc@xxxxxxxxxx]
Sent: Saturday, February 08, 2020 3:28 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: renaming file on IFS
Hello Duane,
Am 07.02.2020 um 23:44 schrieb Danner, Duane <ddanner@xxxxxxxxxxxx>:
Is there a way to have a cl check the folder and if there is a file that starts with %BMOCOM then rename it to CLRBMO.TXT
Not with CL but with qsh, you can pick up the first filename and rename like this:
cd /path/in/ifs; mv `ls -1 '%BMOCOM'* |head -1` CLRBMO.TXT
Please note that in the example above the backticks are essential. These are in function like braces in mathematics: The expression within will be evaluated first and replaced by the evaluated value.
My Example is very crude because,
- it doesn't check if the destination file already exists and blindly overwrites,
- it takes only the first file (to suppress errors if multiple files with a similar name exist).
Pack this into a qsh call and it will do what you need.
(Tested successfully in qsh V4R5 :-) )
:wq! PoC
PGP-Key: DDD3 4ABF 6413 38DE -
https://www.pocnet.net/poc-key.asc
As an Amazon Associate we earn from qualifying purchases.