accessing zip files
Moderators: chulett, rschirm, roy
accessing zip files
Hi
I need to FTP the previous month zip file on every month 2nd into datastage server from unix server.
But in unix server we have earlier monthly files say June2007.gz,May2007.gz,April2007.gz etc.... which are from more than 1 year.
Can any one help me out for how to catch the previous months file into datastage server.
This has to be autamated on everymonth 2nd.
I need to FTP the previous month zip file on every month 2nd into datastage server from unix server.
But in unix server we have earlier monthly files say June2007.gz,May2007.gz,April2007.gz etc.... which are from more than 1 year.
Can any one help me out for how to catch the previous months file into datastage server.
This has to be autamated on everymonth 2nd.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Sort them by date/time modified then select the most recent.
Execute Command activity to execute something like the above command; the return value will give you the file name which you can pass to the job as a job parameter value.
Code: Select all
ls -rt1 | head -1
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can capture the result of the ls command using backquotes, and use that as the first argument of the mv command that renames (or copies) the file prior to its being transferred.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
OP is on Windows, but maybe has MKS Toolkit or similar.
On Windows open a cmd shell and invoke ftp. When the ftp> prompt appears type in a single ? or the word help to get a list of help topics.
On Windows open a cmd shell and invoke ftp. When the ftp> prompt appears type in a single ? or the word help to get a list of help topics.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Doh! Could have sworn I rolled back and checked the OS on the first post, obviously not. Perhaps it was your 'ls -rt1' and the mention of the remote UNIX server that threw me...
Still, that's still all there is to it - other than the need to invoke ftp with the -i option to turn off 'Interactive' mode. As far as I know, you still need to do that for a scripted mget so it doesn't stop and attempt to confirm each one.
Still, that's still all there is to it - other than the need to invoke ftp with the -i option to turn off 'Interactive' mode. As far as I know, you still need to do that for a scripted mget so it doesn't stop and attempt to confirm each one.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi
I have the folder path like this in unxi server: /home/users/ftptci
This path is having the files like May2007.gz,June2007.gz,Jul2007.gz as well other files say 58.gz ,xxxx.gz .
Out of these files which are different names along with monthly file names
as mentioned above.
I need to capture the latest monthly file into my datastage job using FTP stage.
Can you plesae help me out for this.
I have the folder path like this in unxi server: /home/users/ftptci
This path is having the files like May2007.gz,June2007.gz,Jul2007.gz as well other files say 58.gz ,xxxx.gz .
Out of these files which are different names along with monthly file names
as mentioned above.
I need to capture the latest monthly file into my datastage job using FTP stage.
Can you plesae help me out for this.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you don't like the previously offered solution, please say so. It can also be done with a routine, using the STATUS statement to determine the date/time modified (for example).
If you're looking for someone to do the work for you, please contact them privately for a quotation.
If you're looking for someone to do the work for you, please contact them privately for a quotation.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.