SasCommunity Tip of the Day RSS

From sasCommunity
Jump to: navigation, search

Tip of the Day:Submitting a Tip
It's easy to submit Tip of the Day for sasCommunity!

  • First, type a title in the box at right. Type after "Tips:" prefix. Be sure to pick a descriptive name for your Tip.
  • Click Submit a Tip to use the template.
  • Start writing. That's it!
Example, Tips:Your Tip and Tips:Your Other Tip

Tip: Avoid using punctuation characters, e.g., periods, question marks, and so on, as the last character of your article name. And please also review sasCommunity:Titles for some best practices on article titles.

Your Tip will be reviewed by the sasCommunity team and then scheduled for publishing.
*Note: you must log-in or create a sasCommunity UserID first

Attention All Tipsters

We've changed the Tip of the Day template to make it easier to use and so that it provides a direct link to your user page (where your points/status is shown). That new template works for tips submitted from this point forward. For previously submitted Tips, there is no way to automatically update them. But you can update your tips and earn 100 points by simply updating your Tip pages. Simply replace the following text:

<div style="float:right">Submitted By ~~~</div>

To access all of your tips:

  • click on my contributions in the upper right corner of the browser window
  • select the Tips namespace
  • select Search

to get a list of all of the tips you contributed to. But please only update those that you actually created.

More Details

See this Screen Shot as an Example:


Click image to enlarge

Important Tip of the Day Submission Guidelines:

  • Do a bit of searching. Start with the list of tips which have already been proposed. Even if there is no pre-existing tip, there may already be an article on the topic which can be cited or expanded upon.
  • Replace "INSERT YOUR TEXT HERE" in the template with your tip.
  • Replace other upper case text with the appropriate details for your tip.
  • Use plain text (no WIKI or HTML formatting).
  • Do not change or delete any other text in the template.
  • Keep Tips short (no more than a couple of sentences).
  • Link to another internal page or external Web site to provide more details if needed.
  • Remember to save your work by clicking the template's Save Page button!
  • Make sure to include any appropriate category tags. Take a look at the Sasopedia pages to get a sense for what categories might be appropriate.
  • Make sure you are watching the page and that your preferences are set to notify you when someone comments on your submitted tip.

Tip of the Day:July 8

sasCommunity Tip of the Day

proc format;
value age (multilabel notsorted)
  /* 14='14' */ /* values not in the format are excluded from the output */
  /* 16='16' */ /* values not in the format are excluded from the output */
proc summary data=sashelp.class nway;
class name age/mlf;
id sex height weight;
format age age.;
output out=expanded(drop=_type_ _freq_);

Multivalue formats as illustrated in this PROC REPORT example can be quite useful to create reports with multiple overlapping groups. But only a few procedures support such formats.

However you can trick it by using a multivalue format to expand a data creating duplicate rows. This can be useful if you want to run other procedures like PROC UNIVARIATE or do other calculations like counting unique occurrences.

The code at the right illustrates a way to use multilabel formats to create duplicate rows for later analysis. This can be a nice alternative to writing your own code to do, for example, Cartesian products.

The basic idea is to run PROC SUMMARY with the NWAY option where one of the class variables uniquely identifies each input row. In this example, we want to associate each age value with multiple groups. In this case, the variable name uniquely identifies each observation and multiple output observations are created for each of assigned values of age in the format. Since no VAR statement is included, the observations are output/duplicated as is.

  • for each input observation, the output data set has 0 or more output rows with the values defined for age in the format.
  • note that excluding a value from the format results in no output rows.

Submitted By Don Henderson (talk)

Feel free to comment on this tip.

[[Tip of the Day:Error: Invalid time.|Prior tip]] - [[Tip of the Day:Error: Invalid time.|Next tip]] - Random Tip

Submit a Tip

Tip of the Day:July 6

sasCommunity Tip of the Day

When using PROC IMPORT to read CSV files, the SCANTYPE=MIXED option is not available. This means that we do not have an option to force variables to be character. The GUESSINGROWS option can be used, but it can be costly for large files, or potentially not sufficient. Although it does require two passes of the data, there is a way to force all columns to be character when using PROC IMPORT on a CSV file.

Submitted By Art Carpenter (talk)

Feel free to comment on this tip.

[[Tip of the Day:Error: Invalid time.|Prior tip]] - [[Tip of the Day:Error: Invalid time.|Next tip]] - Random Tip

Submit a Tip