Re: FTP from Mainframe to Unix to create a dynamic file name on the Unix



First decide where the "correct" name should be given .....

Option-1 on the MF-side
I guess your mainframe FTP-script is something like this

open that_unix_server
unix_usid unix_pw
put local_file remote_file

Maybe there is a CD somewhere to put it in the right place.
Make the remote_file variable using a REXX or whatever script as
suggested by DD.

Try to find out wheter it's allowed to rename the remote_file. Still
the remote_file must be provided from your MF.

Option-2 leaving it up to the UNIX jockies
Run a shell script that looks somehow like using the KORN shell

#!/bin/ksh
new_name="file_created_in_"
extension=".txt"
month = `ls -l original_file | cut { the column that holds the
datestamp of your file}`
year= `date "+ %Y"`
mv original_file $new_name$year$month$extension

Maybe you have to change the single quotes to double or vice versa.
Anyhow, you can pimp this script by calling with the original_file as
a parameter, etc


Succes,

Kees


.



Relevant Pages

  • Re: pop-forum Re: poplog-dev A look at Poplog on the Macintosh
    ... with the poplink command. ... When trying to make pglink produce a 'sh' rather than a 'csh' shell ... script for linking and when trying to make it put unexpanded environment ... using the shell script pglibr, ...
    (comp.lang.pop)
  • Files appear to be cross linked
    ... script requires a number of standard environment variables to be set ... so it calls a second shell script to set these at the session level, ... control should return to the first shell script, ... that the script executes to the last line prior to the displaying of ...
    (comp.unix.solaris)
  • Re: [PHP] Catch STDERR
    ... into your PHP script? ... Or do you just need STDOUT in one variable, and STDERR in another, ... Another option is to try to write a .sh shell script to get what you ...
    (php.general)
  • Re: basic questions
    ... Setting a script that runs at 3:00 ... Set chron to run that shell script. ... Debug the GUI application with the REPL. ... You start up the Web browser, then browse the Web, visit a hundred ...
    (comp.lang.lisp)
  • Re: Converting large bash script to TCL
    ... I know that TCL and shell scripting share a lot of similarities. ... The shell script ... Determine what it (the script) is supposed to do ... echo "WOULD YOU LIKE TO INSTALL NAC DRIVER ...
    (comp.lang.tcl)