BookmarkSubscribeRSS Feed
Kwok
Calcite | Level 5
We are trying to write a SAS dataset in MVS to a PC txt file through the filename ftp
method as follows:

FILENAME OUTIT FTP "FILE.TXT" HOST='xxx-xxx-xxx' CD="\PATH" USER='ANONYMOUS' PASS= "&PASS" RECFM=FB LRECL=240 ENCODING=ASCII ;

DATA _NULL_ ;

SET SASDATA ;
FILE OUTIT ENCODING=ASCII LINESIZE=240 ;

PUT
...... ;
RUN;

The process works and the log shows the correct line output to the pc file. But when I browse the output with word pad, it concatenate the file into 1 long line. Looks like the carriage return is missing from each line. Does anybody have any idea how to write out a carriage return at the each line ?

I realized there are other ways to skin this cat but this is part of a macro that is writing out to different platforms and we are trying to avoid another JCL or data step.

Thanks for all your help.

Kwok
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
As I understand it, this is a Windows NotePad problem. The data structure is correct. As a circumvention, open the file with WordPad, and if you save the file once, then you can open it with NotePad after.

Scott Barry
SBBWorks, Inc.
Kwok
Calcite | Level 5
Hello Scott,

Thanks for your info. But my problem is with word pad. The word pad put all the line without carriage return. Note pad looks aweful too. Any other idea ?

Thanks
Kwok
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Review the SAS Companion for z/OS documentation -- refer to the TERMSTR and ENCODING discussions (there are multiple references). Also, I recommend coding as few parameters as required, letting SAS defaults take unless absolutely required. I have no problem doing FTPs (EBCDIC-to-ASCII) from SAS FILENAME with FTP engine to Windows/Unix, except for the Windows NotePad/WordPad behavior differences.

Scott Barry
SBBWorks, Inc.

SAS support website:

http://support.sas.com/


SAS 9.1.3 for z/OS Companion Guide
http://support.sas.com/documentation/onlinedoc/91pdf/sasdoc_913/base_zoscom_8406.pdf
data_null__
Jade | Level 19
You are telling SAS to create the file without record terminators the F in the record format.

RECFM=FB F means fixed, no record termination strings.
LRECL=240 is logical record length.

So the records do not have termination strings as in "regular" windows files. I can't test it but I think if you change RECFM=V then you will get the proper records.
Kwok
Calcite | Level 5
Thanks very much for your recommendation. It works !

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 5 replies
  • 7268 views
  • 0 likes
  • 3 in conversation