IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FTP datasets to server


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunny8088

New User


Joined: 06 Apr 2017
Posts: 4
Location: United States

PostPosted: Thu Jun 17, 2021 2:36 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Thu Jun 17, 2021 2:54 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Thu Jun 17, 2021 9:44 am
Reply with quote

Why not using MPUT?
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Thu Jun 17, 2021 1:37 pm
Reply with quote

Quote:
how many I have

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Thu Jun 17, 2021 2:57 pm
Reply with quote

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
View user's profile Send private message
sunny8088

New User


Joined: 06 Apr 2017
Posts: 4
Location: United States

PostPosted: Thu Jun 17, 2021 5:23 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Jun 17, 2021 7:55 pm
Reply with quote

ibmmainframes.com/about62698.html
Or write a program.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Jun 18, 2021 1:46 am
Reply with quote

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
View user's profile Send private message
sunny8088

New User


Joined: 06 Apr 2017
Posts: 4
Location: United States

PostPosted: Fri Jun 18, 2021 2:06 am
Reply with quote

Good idea, but all files have to be create during DAY
and FTP only once in night
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Jun 18, 2021 3:56 am
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Fri Jun 18, 2021 1:19 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jun 18, 2021 3:38 pm
Reply with quote

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
View user's profile Send private message
sunny8088

New User


Joined: 06 Apr 2017
Posts: 4
Location: United States

PostPosted: Fri Jun 18, 2021 6:51 pm
Reply with quote

Thank you all for taking time and responding.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Sat Jun 19, 2021 4:09 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts Z Monitoring server fails to start IBM Tools 1
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts define 1 DCB parms for multiple outpu... JCL & VSAM 9
Search our Forums:

Back to Top