Writing to existing mainframe file via FILENAME FTP

Reply
N/A
Posts: 1

Writing to existing mainframe file via FILENAME FTP

II've scoured the internet for examples, but my team and I can't seem to get this done. I'm unfamiliar with mainframes, but the mainframe admin has supplied us what he says are valid values for the relevant dummy values below.


FILENAME theFile FTP 'filenameOnMainframe' HOST=’hostname’ PORT=portnum

LRECL=80 BLOCKSIZE=6160 USER=’USERNAME’ PASS='PASS'

RECFM=F ENCODING=ASCII DEBUG RCMD='SITE CY PRI=15 SEC=50';

DATA _NULL_;

     FILE theFile;

PUT @1 'TEST';

RUN;


When I run the above, I get these errors:

ERROR: Open failed for file FTP1  

ERROR: The connection has timed out..

Presuming my values are correct, any ideas on why this is not working? We've had success FTPing to, say, a shared drive.

Trusted Advisor
Posts: 3,212

Re: Writing to existing mainframe file via FILENAME FTP

Posted in reply to RgrWilliams

Would start first reading a Mainframe dataset. Just to check host-ip portnumber are not blocked by firewalls.

Possible start using ping  telnet (change to port 21/22 instead of 23)

The message is suggesting the partner is not reachable

SAS(R) 9.4 Statements: Reference (filename)

The rcmd should come form the mainframe guys as validated values. When not, you are giving command that are in error.
The port number is 21 (I believe) for old classic FTP, with encryption it 22 and indicated as SFTP. Logical/functions no difference.

The filename can be hierarchic (HFS like Unix) or classic 8.8.8. naming (z/os bound).  Both are controlled by RACF (ACF-2) for the authorisation.

The locking of the dataset is different. See the diiferences on that see DISP= options. In that case I would advice using a PDSE (existing-preallocated) and not coding lrecl/blksize).  

SAS(R) 9.4 Companion for z/OS  (filename Z/OS)    

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 1 reply
  • 538 views
  • 3 likes
  • 2 in conversation