BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all,

I have a scenario wherein I am reading an external file using file reference. My file contains several input lines which are blank. But sas condenses multiple blank lines into a single blank line when I am writing it to a file of RECFM=FBA. But it works fine with RECFM=FB.

Please let me know how to overcome this problem.
Here is the piece of code I am using.

data _null_
infile 'test file' missover print truncover;
input @1 record $133;
file out1 notitle;
put @1 _infile_;
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
If you inspect the file, column 1 contains a print-control character for single, double-spacing. One technique to force a data line to be generated is to use a non-print character such as hex-00, as in:

PUT '00'X;

The caveat here is that you are asking for system-controlled line-skip and pagination print with the RECFM=FBA and the FILE stmt parameter PRINT, correct? The only alternative I can identify for you is to put something other than a blank line, as I have described above.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Thanks for the reply scott.

Can you please tell when to use PUT '00'X;

Do I need to use any check like if rec ' ' then PUT '00'X; Or what else?
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Any type of check will depend on your SAS program and what you expect it to generate for output. If you simply want to generate extra blank lines and not have the system-generated line-control character, you would use the PUT statement without any checks. So, it will depend on your output requirements.

Scott Barry
SBBWorks, Inc.

sas-innovate-2024.png

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.

 

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