BookmarkSubscribeRSS Feed
tylerjazz
Calcite | Level 5

Hello, I'm trying to FTP data from a local PC SAS data set onto a z/OS mainframe flat file. I'm able to use the FILENAME statement to FTP the data, but it's not in the right format. I've tried changing the formats of the data in the data set, but it keeps looking like junk data. However, if I view the data with ASCII data encoding, I can see that the data's there, but just in a different format. Also, if I FTP the data manually from a text file through Filezilla (transferring as ASCII) it works like a charm. Here's the top of the data viewed with ASCII:

**COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED

LIB CONTROL W32_7PRO¼ SAS9.4¼

 

It seems to me like it's posting some of the data set's meta data or something? Here's the data set with the FILENAME FTP, and the PROC CPORT to get it onto the mainframe:

 

data RTR3;
   set RTR2;
   d=strip(a||date||c);
   keep d;
run;

FILENAME RTR3 FTP "'TEST.RTR.TAB21.RTR3'"                         
	Host = 'atrsyse'
    User = "&user" Pass = "&pass" Rcmd = 'ascii';

PROC CPORT DATA = RTR3 FILE = RTR3;
RUN;

Version 9.4 on PC and mainframe.



2 REPLIES 2
Tom
Super User Tom
Super User

The beginning of that file makes it look like a SAS export file.  If so then it is a BINARY file even though the beginning of it looks like text. If you transfer it as ASCII (or text) to an IBM mainframe then it will be converted to EBCDIC and the content will be unreadable.

SASKiwi
PROC Star

You need to FTP the CPORTed file using the BINARY option to a z/OS file that has LRECL set to 80 and BLKSIZE to 8000. PROC CIMPORT on z/OS requires an ASCII-formatted file hence the need to use BINARY to retain this format.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 633 views
  • 0 likes
  • 3 in conversation