FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 25th, 2004, 06:56 PM
rxsid rxsid is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 221 rxsid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 43 m 33 sec
Reputation Power: 6
Question PHP to FTP JCL to MainFrame?

Hi all,

Trying to FTP some JCL to a mainframe from a winNT box using PHP 4.3.1.
I can successfully open a cmd prompt, ftp the commands and the JCL file up and have the m/f run the jcl.

I can't get my php script to send the jcl. The ftp_site doesn't seem to be mimicking ftp commands. I can't use ftp_raw cause I can't load 5.0 right now.
PHP Code:
 $ftp_server "mainframeDNS";

$ftp_user "userid";
$ftp_pass "password";

$conn_id ftp_connect($ftp_server) or die (writeError($logsPath,$errorLog$gmtDate."\r\n FTP ERROR>> " $conn_id "\r\nCould Not Establish FTP Connection to ".$ftp_server.".\r\n\r\n",$rptName,$univDate));

// try to login
if (!ftp_login($conn_id$ftp_user$ftp_pass)) {
    
writeError($logsPath,$errorLog$gmtDate."\r\n FTP ERROR>> " $conn_id "\r\nCould Not Log On To FTP Connection using ".$ftp_user.".\r\n\r\n",$rptName,$univDate);
}
ftp_site($conn_id'ascii') or die ("ERROR FTP SITE 1");
ftp_site($conn_id'quote site filetype=jes') or die ("ERROR FTP SITE 2");
ftp_site($conn_id'put C:\\Reports\\scripts\\cpo070jcl.txt') or die ("ERROR FTP SITE 3"); //cpo070jcl.txt contains valid MVS jcl.


//ftp_put($conn_id, "C:\\Reports\\scripts\\cpo070jcl.txt", FTP_ASCII) or die ("ERROR FTP PUT");  //This one requires 4 parms, including a mainframe file name...which isn't what i need..i'm not storing a file...just trying to send the jcl to the jes reader.
ftp_quit($conn_id); 


Any ideas on a work around? How could I open the windows command prompt and send it (win cmd prompt) the commands?

Thanks in advance.

Reply With Quote
  #2  
Old March 25th, 2004, 07:41 PM
Sepodati's Avatar
Sepodati Sepodati is offline
Banned
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Dec 1999
Location: Afghanistan
Posts: 14,378 Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)Sepodati User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate FolderFolding Points: 70305 Folding Title: Intermediate Folder
Time spent in forums: 2 Months 3 Weeks 6 Days 22 h 12 m 4 sec
Reputation Power: 1784
Send a message via ICQ to Sepodati Send a message via Yahoo to Sepodati
What do you mean "i'm not storing a file"?? You're putting one there, aren't you?

Why not try

ftp_put($conn_id, 'cpo070jcl.txt', 'C:\\Reports\\scripts\\cpo070jcl.txt', FTP_ASCII)

---John Holmes...

Reply With Quote
  #3  
Old March 26th, 2004, 12:43 AM
rxsid rxsid is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 221 rxsid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 43 m 33 sec
Reputation Power: 6
Question

Thanks for the reply sepodati.

I'm not trying to store the file.

What I'm trying to do is send the JCL that is contained in the text file on the client/server...to the mainframe so that the mainframes internal JES reader can kick off the instructions contained in the JCL.

So, basically...the file never gets stored. It's contents are used as one time "instructions" on the mainframe.

I can manually open a command prompt on the windows box and start an FTP session. Then type:

ftp> ascii
ftp> quote site filetype=jes
ftp> put C:\\Reports\\scripts\\cpo070jcl.txt

and with that...the JCL (job control language) starts to run on the mainframe. After the job completes...the JCL "goes away".

I just can get this manual command line input to be done by my script.

Any other ideas?

Thanks.

Reply With Quote
  #4  
Old March 26th, 2004, 12:49 AM
rxsid rxsid is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 221 rxsid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 43 m 33 sec
Reputation Power: 6
does anyone offhand know "for sure" if ftp_raw will do the trick?

in other words...will it mimic exactly like as if I were manually typing the ftp commands from a command window?

if so, i'll have to have this knowledge to justify the work on our server to complete an upgrade to php 5.0, which isn't "production" stable as of right now.

Thanks!

Reply With Quote
  #5  
Old March 29th, 2004, 12:51 PM
rxsid rxsid is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 221 rxsid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 43 m 33 sec
Reputation Power: 6
Arrow Resolved:

ok...I figured it out with a different approach:

PHP Code:
 system("FTP -s:c:\\Reports\\scripts\\FTPputFile.txt\n"); 


On the win NT box...that opens a command line screen, starts FTP and reads in line by line the ftp commands found in FTPputFile.txt which contain:

Code:
open mainframeDNS
userid
pass
ascii
quote site filetype=jes
put cpo070jcl.txt
quit


works like a charm!!

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > PHP to FTP JCL to MainFrame?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway