View previous topic :: View next topic
|
Author |
Message |
sunny8088
New User
Joined: 06 Apr 2017 Posts: 4 Location: United States
|
|
|
|
I create N number of datasets (from A to X)
PROD.RECON.MERGE.A
PROD.RECON.MERGE.B
....
PROD.RECON.MERGE.K
I want to FTP these dataset to server how can I determine @ run time how many I have and build a PUT statement
THanks |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
Since you create the datasets yourself (from A to X), then you already know exactly how many of them you’ve got.
There are approx. 100,500 ways to create PUT statements. You need to be more specific in your question, “how to create them”. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1334 Location: Bamberg, Germany
|
|
|
|
Why not using MPUT? |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Do a LISTCAT and post-process the output. REXX is good for that, especially as you can have the LISTCAT and postprocess in the same module, but any programming language will do. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1334 Location: Bamberg, Germany
|
|
|
|
Code: |
FTP MPut subcommand---Copy multiple data sets to the remote host
Purpose
=======
Use the MPut subcommand to copy multiple data sets from your local host to the remote host. |
|
|
Back to top |
|
|
sunny8088
New User
Joined: 06 Apr 2017 Posts: 4 Location: United States
|
|
|
|
I do not know at run time how many datasets will be created.
it could be 1 or could be 10 (or 15).
Sunny |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
I do not know at run time how many datasets will be created. |
You did not provide any logic... I assume there is a loop of some kind. As soon as you create the data set (and populate it with data), submit the FTP command. FTP before proceeding to the next data set. |
|
Back to top |
|
|
sunny8088
New User
Joined: 06 Apr 2017 Posts: 4 Location: United States
|
|
|
|
Good idea, but all files have to be create during DAY
and FTP only once in night |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
sunny8088 wrote: |
Good idea, but all files have to be create during DAY
and FTP only once in night |
You can still create MPUT control card using DFSORT and use that output in SHR mode as an additional step after every other Data Set is created. At the end you will have all the Data Set to be SFTP'd.
Set up one job EOD to run using that control card.
Or
Step1, Since you know all the Data Set names in advance , have them in one PS Data Set ( all of it even if they may not get created today),
Step2, REXX could easily able check if Data Set is cataloged , if yes then write out else no ( you can search how to do in REXX).
Step3, Use output from step2 to prep a final SFTP control card suing DFSORT as easy or any choice of programming language.
You might as well could skip step3 and do it in step2 if you know REXX.
Step4, Use the final SFTP control card from step2/3 to send once at night.
ibmmainframes.com/about10519.html
ibmmainframes.com/viewtopic.php?t=22165 |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Quote: |
I do not know at run time how many datasets will be created. |
Hence the suggestion from me and others that you need a program (I recommend REXX) to list the datasets and then generate FTP commands from that list. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
to list the datasets and then generate FTP commands from that list. |
while the suggwstion is reasonsable for other situations ,
it does not suit well the current requirements
let' s suppose that the datsets involved are ALL cataloged and kept around for a few days
a journaling system would be needed to keep track of what has been ftp' ed and when
and... and... and...
the info provided by the TS is not enough to give a reasonable advice
IMO for mission critical data exchange FTP and friends are not the best tools to be used |
|
Back to top |
|
|
sunny8088
New User
Joined: 06 Apr 2017 Posts: 4 Location: United States
|
|
|
|
Thank you all for taking time and responding. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
I create N number of datasets (from A to X) |
The name should include the date and time so that you can keep track of which ones need to be FTP'd. |
|
Back to top |
|
|
|