Can I ftp or upload a .csv file created within Linux SAS EG to a Mainframe File?

Reply
Contributor
Posts: 30

Can I ftp or upload a .csv file created within Linux SAS EG to a Mainframe File?

I am trying to convert all of my processes to SAS EG and not use my Mainframe SAS.  Here is my current dilemma:  I am currently running a SAS EG program that accesses my source data on the Linux Metadata server and then creating a CPORT file of it.   I then use Reflection FTP software to move it to a Windows environment, where I use the Mainframe FTP software to upload it to a Mainframe file.  Then in the mainframe environment, I run a SAS job that reads in the CPORT file and outputs it to a .csv file housed in a mainframe disk location.  My client access the .csv file from mainframe with COBOL I believe.

Can I cut to the chase by creating my .csv file in my EG session and then using SAS connect or some FTP magic to upload it to our mainframe environment?  I have successfully been able to READ mainframe files using the FILENAME FTP coding, but I can't seem to find any examples where I can SEND a file to the mainframe.

Any ideas?  Thanks!

Respected Advisor
Posts: 3,889

Re: Can I ftp or upload a .csv file created within Linux SAS EG to a Mainframe File?

Where to start?...

SAS EG is a fat client locally installed on your PC. This client allows you to connect to SAS Server(s) and execute your SAS code there. In order to do so you first need to authenticate yourself on a SAS Metadata Server and retrieve metadata information about the Servers (and other stuff) available to you.

You can have multiple servers available to you - and it could even be Mainframe SAS. What you will actually see in the server pane depends on what has been assigned to you in your metadata profile and what is available (eg. it can be that not all necessary SAS modules are licensed on the Mainframe to allow access via EG).

It is very important that you're always aware of where your code actually executes (on which server) as you need to code all paths and the like as they are seen from the server.

Let's assume one of the servers (=compute tier) available to you is SAS on the Mainframe. You then could simply copy the code from your PDSE member into a EG code node, remove the JCL part (eventually replace JCL alloc with libnames) and then execute this code 1:1 on the mainframe server (select server, run).

If the Mainframe is not available to you out of EG then you need to execute your code on another server as a start. If you have SAS/Connect licensed and you can start a remote session on the Mainframe from your Linux server then this could be an approach (rsubmit, proc upload of your dataset created on the Linux SAS side and then in the rsubmit block which executes on the mainframe you create the csv out of the uploaded dataset).

If there is no SAS/Connect: You can create your .csv on the Linux server and then FTP it to the Mainframe. You can use a "filename" with the "pipe" or "ftp", or a  'X' command (all documented in the Base SAS Online doc) to do so. One thing about this: The default installation settings don't allow such commands. Run "Proc Options" executed on your Linux SAS server and look in the log for NOXCMD. If this option is set then you can't issue an FTP command out of SAS. Else it should work and as you're already doing it manually you should also have all the necessary credentials.

And here the docu link for the Filename statement with the FTP access method inclusive examples: http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000178980.htm

Contributor
Posts: 30

Re: Can I ftp or upload a .csv file created within Linux SAS EG to a Mainframe File?

Thanks.  I was able to get my file to the mainframe using the FTP process. Smiley Happy

Do I always have to state the Blocksize?  Or can it calculate it on its own?

Respected Advisor
Posts: 3,889

Re: Can I ftp or upload a .csv file created within Linux SAS EG to a Mainframe File?

I would assume a default will be used if you don't specify one. I would explicitly specify it together with LRECL and RECFM.

Ask a Question
Discussion stats
  • 3 replies
  • 1146 views
  • 3 likes
  • 2 in conversation