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.
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)
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.