Desktop productivity for business analysts and programmers

Is there an easy way to make the same formatting corrections on all of the tables at one time

Accepted Solution Solved
Reply
Highlighted
Occasional Contributor
Posts: 14
Accepted Solution

Is there an easy way to make the same formatting corrections on all of the tables at one time

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 Smiley Happy.

 

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;

 


Accepted Solutions
Solution
‎03-08-2018 10:56 AM
PROC Star
Posts: 1,316

Re: Is there an easy way to make the same formatting corrections on all of the tables at one time

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


All Replies
PROC Star
Posts: 1,316

Re: Is there an easy way to make the same formatting corrections on all of the tables at one time

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

Occasional Contributor
Posts: 14

Re: Is there an easy way to make the same formatting corrections on all of the tables at one time

Hi Tom,

 

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

 

Gökhan

Super User
Posts: 13,583

Re: Is there an easy way to make the same formatting corrections on all of the tables at one time


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.

Occasional Contributor
Posts: 14

Re: Is there an easy way to make the same formatting corrections on all of the tables at one time

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.

 

Solution
‎03-08-2018 10:56 AM
PROC Star
Posts: 1,316

Re: Is there an easy way to make the same formatting corrections on all of the tables at one time

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

Occasional Contributor
Posts: 14

Re: Is there an easy way to make the same formatting corrections on all of the tables at one time

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 166 views
  • 2 likes
  • 3 in conversation