BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cosmid
Lapis Lazuli | Level 10

I have the following code: 

data sample1;
  input a;
datalines;
1
2
3
run;

data sample2;
  input b;
datalines;
1
2
3
run;

data sample3;
  input c;
datalines;
1
2
3
run;


%macro print_sample(input_data);
  proc print data=&input_data;
  run;
%mend print_sample;

%print_sample(sample1);
%print_sample(sample2);
%print_sample(sample3);

As you can see, I just printed the 3 sample data. However, the result showing in UNIX is as follows: 

                                                            The SAS System                            15:01 Tuesday, June 8, 2021   1

                                                              Obs    a

                                                               1     1
                                                               2     2
                                                               3     3
^L                                                           The SAS System                            15:01 Tuesday, June 8, 2021   2

                                                              Obs    b

                                                               1     1
                                                               2     2
                                                               3     3
^L                                                           The SAS System                            15:01 Tuesday, June 8, 2021   3

                                                              Obs    c

                                                               1     1
                                                               2     2
                                                               3     3

"The SAS System" for 2nd and 3rd result is right below the result of the first macro's result. Is there a way to insert a blank line in between the results or add a blank page?

 

I asked this before but didn't get a solution because I didn't provide any code and my question wasn't very clear. Please let me know if this is clear for what the objective is. Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Who still uses listing output? Usually PDF, Word, Excel or HTML are standard these days.

Try adding blank title or footnote statements to add extra space, it's probably the quickest fix.

title ' ';
footnote ' ';

Example:

https://communities.sas.com/t5/New-SAS-User/Add-spaces-in-listing-file/td-p/592853

View solution in original post

6 REPLIES 6
cosmid
Lapis Lazuli | Level 10
Also, how do you remove the ^L in the output? What's creating it?
Tom
Super User Tom
Super User

This has nothing to do with the macro processor.

There are already "blank lines" between the outputs. In fact each proc's output is starting on its own page.  That is what the FORMFEED ('0C'x) character means.

ballardw
Super User

@Tom wrote:

This has nothing to do with the macro processor.

There are already "blank lines" between the outputs. In fact each proc's output is starting on its own page.  That is what the FORMFEED ('0C'x) character means.


Ah! The joys of trying to remember things like FORTRAN Carriage Control (or not) characters.

 

Makes me a tad nostalgic for the "not quite so good old days". 🤣

cosmid
Lapis Lazuli | Level 10
In SAS studio's output, they do start on a new page. But in UNIX, the result are glued to each other. So that's why I was trying to see if there's a way to fix it.
Reeza
Super User

Who still uses listing output? Usually PDF, Word, Excel or HTML are standard these days.

Try adding blank title or footnote statements to add extra space, it's probably the quickest fix.

title ' ';
footnote ' ';

Example:

https://communities.sas.com/t5/New-SAS-User/Add-spaces-in-listing-file/td-p/592853

cosmid
Lapis Lazuli | Level 10
Hi Reeza, that's actually what I am doing right now to fix the issue. I thought there's a better way of doing it. My code runs on UNIX:( And I just wanted to see if there's a way to separate out each result. Thanks for the help:)

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 847 views
  • 2 likes
  • 4 in conversation