FTPing to or from a Mainframe GDG

Question: I want to know how to ftp a file from unix into an MVS GDG file.
Anonymous

Answer: When I first received this question, I was not aware of any means that could be used to FTP to a GDG without specifying the exact filename of the file within the GDG to which you are FTPing.

More recently, I received an email from Greg Matsuda with an explanation of two methods that can be used to FTP to a mainframe GDG specifying the relative generation number. He has kindly given me permission to share this information with you. The information that he provided tells you how you can use GDG relative references such as (0) or (+1) when referring to files within ftp provided that you set up the receiving mainframe appropriately first.

Note that where the example shows apostrophes these must be specified as part of the statement in order for the command to work correctly. What you place between the apostrophes will depend on the name you are assigning to the GDG.

As far as I can determine, method one should work for both sending to and receiving from a GDG when the transfer is run from the other system, method two should work for sending or receiving a GDG when run on either system.

Here's what Greg said in his email.

Method One

1. On the mainframe create a model DSCB. On my system I created 'TC9701.DSCB' the attributes can look like this:


Data Set Information
Command ===>
Data Set Name  . . . : TC9701.DSCB
General Data                      Current Allocation
Volume serial . . . : ASA001      Allocated tracks  . : 0
Device type . . . . : 3390        Allocated extents . : 0
Organization  . . . : NONE
Record format . . . : ?
Record length . . . : 0
Block size  . . . . : 0           Current Utilization
1st extent tracks . : 0           Used tracks . . . . : 0
Secondary tracks  . : 0           Used extents  . . . : 0
Creation date . . . : 2002/07/13
Referenced date . . : ***None***
Expiration date . . : ***None***

2. Create your GDG Base, I used 'TC9701.SPUFI.TXT'

3. From Unix or Windows (DOS Prompt) logon to the FTP Host as normal, however, before issuing the 'PUT' command, type:


TYPE ASCII
LITERAL SITE DCBDSN='TC9701.DSCB'

4. Then from the enter the PUT command:

PUT spufi.txt 'tc9701.spufi.txt(+1)'

Note: for the UNIX filename the case must match, the case does not matter for the Mainframe or Window (DOS Prompt)

 

Method Two

If your FTP system does not support the 'LITERAL' command, here is an alternative method:

1. Decide what your HLQ will be, (I chose SYA7), and find out what catalogue it will use, type:

TSO LISTCAT LVL(SYA7)

There may be a bunch of datasets listed, but the first one will tell what catalogue (IN-CAT). Mine looks like this:


NONVSAM ------- SYA7.$AVRS.R40.INSTLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40.ISPMLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40.ISPPLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40.ISPTLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40.LOADLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40.MACLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40B.INSTLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40B.ISPMLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
NONVSAM ------- SYA7.$AVRS.R40B.ISPPLIB
IN-CAT --- CATALOG.AUS01.SYSTEMS
***

Note: Just hit PA1 to cancel the rest of the listing.

2. Now find out what volume your catalog is on, here's mine:


Menu  Options  View  Utilities  Compilers  Help
----------------------------------------------------------
DSLIST- DataSets Matching CATALOG.AUS01.SYSTEMS Row 1 of 1
Command ===>                              Scroll ===> CSR
Command - Enter "/" to select action      Message   Volume
----------------------------------------------------------
CATALOG.AUS01.SYSTEMS                               TS9303
******************** End of Data Set list ****************

3. Now create your GDG Base, do not create it on the same volume where the catalogue resides, I created SYA7.GDG.TEST

4. Now create your model DSCB, this must be on the same volume as the catalog and it must have the same name as the GDG Base. This dataset must not be catalogued.

5. Now run your FTP, as normal without the 'LITERAL' command.

 

This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow
Donate