AS400 IFS file rename

I am Running a process which read each month  control record by reading one record for each month from Physical file & that process create 3 csv files on each month in ifs (/home/one) for each month same name which I have this automated through CL.

Now I have to add another functionality so that will move the  files from /home/one/*.csv  to /home/two/Jan_2017_*.csv and read the next month control record.

I Have the prefix Jan_2017  to Dec_2017  also in the physical file.

How can I add this functionality into my CL for each month?

Thank you in advance as always.
OramcleAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MurpheyApplication ConsultantCommented:
I advise to use the Qshell option to rename the files

But is it's archive only you also can zip them from the as/400, with qshell
e.g.

QSH CMD('cd /HOME/ONE')
QSH CMD('jar -cfM /HOME/TWO/Jan_2018.zip  *')


Or from CL:
CHGVAR     VAR(&CMD)  VALUE(' jar -cfM /home/tku/two/Jan_2018.zip  *' )
STRQSH     CMD(&CMD)

of course you can create the &CMD parameter dynamically
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Phillip KnoxSenior Systems AnalystCommented:
"Now I have to add another functionality so that will move the  files from /home/one/*.csv  to /home/two/Jan_2017_*.csv and read the next month control record."

So you have a Jan_2017_.csv file in /home/one that you want moved to /home/two?
0
MurpheyApplication ConsultantCommented:
MOV OBJ('/home/one/*.csv')    
               TODIR('/home/two/Jan_2017/*csv')      
0
MurpheyApplication ConsultantCommented:
both are good options
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.