BookmarkSubscribeRSS Feed
RgrWilliams
Calcite | Level 5

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.

1 REPLY 1
jakarman
Barite | Level 11

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 --<-----

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1509 views
  • 3 likes
  • 2 in conversation