How to send my most recent dataset by FTP?
Asked Answered
L

1

7

I am using IBM Mainframe TSO to view files from a dataset. I recently have been told to start FTPing the latest generation dataset everyday to a folder on my desktop. The problem is that the FTP script I have only lets me FTP a file with the exact name I put. Everyday the dataset changes.

How can I write a script that will FTP the latest generation? Please see example below of how the dataset changes:

Dataset

8/30/18 - KIBI.AL242422.REPORT.G6441V00
8/31/18-  KIBI.AL242422.REPORT.G6442V00
9/1/18 -  KIBI.AL242422.REPORT.G6443V00
9/4/18 -  KIBI.AL242422.REPORT.G6444V00
9/5/18 -  KIBI.AL242422.REPORT.G6445V00

command.bat

ftp -i -s:Command.txt
quit

command.txt

open sc01.sample.com
USER NAME
PASSWORD
get 'KIBI.AL242422.REPORT.G6441V00'
Lonnie answered 6/9, 2018 at 12:44 Comment(4)
What is the client you are using? You should be able to access 'KIBI.AL242422.REPORT(0)' and the host would resolve that for you.Sharpwitted
Will this work? In the FTP Client cd /KIBI and then get AL242422.REPORT(0). Are you pulling from the mainframe or pushing? What client are you using?Sharpwitted
@Sharpwitted if he is using windows cmd and zOS using the relative GDG as you suggested will work. I do this everyday. It will resolve the relative name to the fully qualified nameKursk
Hi Hogstrom this worked. Thank you very much! Just had to add the "(0)'Lonnie
S
9

What your referring to are Generation Data Groups. You can refer to the files in relative form where (0) is the most current. (-1) is the previous generation, etc. In your case you want to access the dataset by relative reference. In your FTP client do the following:

cd KIBI

get AL242422.REPORT(0)

The system will determine which of the datasets is the one you want. Its a nice feature.

Sharpwitted answered 6/9, 2018 at 14:49 Comment(1)
As an aside the reader should be extremely aware that without the subscript you will get them ALL as a concatenation.Ipsus

© 2022 - 2024 — McMap. All rights reserved.