BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
chinaski
Obsidian | Level 7

Hello,

 

In a SAS Project i have 80 tables which i have made from both PROC TABULATE and summary reports, so the manager gave me some corrections on formatting the table, i know how to fix them but the problem is that i don't want to get in the codes of all 80 tables and change the same codes.

So my question is, is there an easy way to make the same corrections on these 80 tables at one time. One example is shown below, thanks for your help :).

 

Initial state:

 

PROC TABULATE
DATA=WORK.datax ;
VAR BIRIMNO;
CLASS GENDER/ ORDER=UNFORMATTED MISSING;
CLASS AGE / ORDER=UNFORMATTED MISSING;

 

Final state:

 

PROC TABULATE
DATA=WORK.datax ;

options nodate number     ;  *THE CHANGE I WANT TO MAKE;
VAR BIRIMNO;
CLASS GENDER/ ORDER=UNFORMATTED MISSING;
CLASS AGE / ORDER=UNFORMATTED MISSING;

 

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

Absolutely!

 

Here's an example of a table set up the way you don't want, with the date and no page number:

 

 Print1.png


To fix it as I suggested, in Enterprise Guide select File -> New -> Program. That will display the EG program editor. In the editor, type the following code:

 

options nodate number;

From here you have several options. You can just press the "Run" button, which will run the code. From this point on, as long as you're in the same SAS session, these options will apply.

 

If I do that, and then run the table process again, the results look like this (the edit icon is right over the page number, sigh!):

 

Print2.png

 

Or you can click on the Close icon, and you'll see your program on your process flow. You can right-click it, and select Run, and again it will set the options.

 

Or you can link it to one or more of your table-creation steps, like this:

 

Print3.png


Then if you right click on the program and select "Run Branch from Program", it will set the options and create your table.

 

If you want to reverse the options, just create a new program as described above, and enter:

 

options date nonumber;

 

When you run it your output will revert to displaying the date and no page number.

 

Tom

View solution in original post

6 REPLIES 6
TomKari
Onyx | Level 15

I was running some very esoteric ideas through my head until I found what change you want. Fortunately, this one is easy. Those options can be set anywhere in a SAS session, so just create a small program with your options statement, run it before you run any of the tables, and then if desired run another small program to reverse it. As long as you're in the same SAS session, the options will apply to your PROC TABULATE.

 

Tom

chinaski
Obsidian | Level 7

Hi Tom,

 

Thanks for the reply, can you give me an example about it or a link that gives such examples.

 

Gökhan

ballardw
Super User

@chinaski wrote:

Hi Tom,

 

Thanks for the reply, can you give me an example about it or a link that gives such examples.

 

Gökhan


Options set  with the OPTIONS statement are for the entire SAS session until changed So:

 

options nodate nonumber;

 

<first proc tabulate>

<second proc tabulate>

<other procedures>

...

<last output procedure>

 

options date number;

 

would generate all of the output between the first options statement and the last without page numbers or dates in the output. The last option resets output to include those items.

chinaski
Obsidian | Level 7

Ok, now i realised it, thank you so much, but i also wrote the code after table statement "/nocontinued" to supress "continued" word shown at the bottom of the page when there is more than one page, is it also possible to write it with options statement so that i can see it in all the tables i created when there is more than one page.

 

TomKari
Onyx | Level 15

Absolutely!

 

Here's an example of a table set up the way you don't want, with the date and no page number:

 

 Print1.png


To fix it as I suggested, in Enterprise Guide select File -> New -> Program. That will display the EG program editor. In the editor, type the following code:

 

options nodate number;

From here you have several options. You can just press the "Run" button, which will run the code. From this point on, as long as you're in the same SAS session, these options will apply.

 

If I do that, and then run the table process again, the results look like this (the edit icon is right over the page number, sigh!):

 

Print2.png

 

Or you can click on the Close icon, and you'll see your program on your process flow. You can right-click it, and select Run, and again it will set the options.

 

Or you can link it to one or more of your table-creation steps, like this:

 

Print3.png


Then if you right click on the program and select "Run Branch from Program", it will set the options and create your table.

 

If you want to reverse the options, just create a new program as described above, and enter:

 

options date nonumber;

 

When you run it your output will revert to displaying the date and no page number.

 

Tom

chinaski
Obsidian | Level 7

Thats awesome, very useful information for me. Thank you very much Tom for your time, very much appreciated.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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