<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Format questions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62054#M13507</link>
    <description>Hi, MarcTC.&lt;BR /&gt;
for qustion 2;&lt;BR /&gt;
you can specify 'format (var);'&lt;BR /&gt;
here's a example.&lt;BR /&gt;
data test;&lt;BR /&gt;
input a @@;&lt;BR /&gt;
format a dollar5.1;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2 3&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
data akari;&lt;BR /&gt;
set test;&lt;BR /&gt;
format a;&lt;BR /&gt;
run;</description>
    <pubDate>Thu, 13 Jan 2011 07:53:31 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-01-13T07:53:31Z</dc:date>
    <item>
      <title>Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62053#M13506</link>
      <description>What is F10.4 format? I can't find any web page in SAS explaining this format.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Second, a dataset has user defined formats attached to some variables. How to "decode" these user defined formats? &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance!</description>
      <pubDate>Thu, 13 Jan 2011 06:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62053#M13506</guid>
      <dc:creator>MarcTC</dc:creator>
      <dc:date>2011-01-13T06:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62054#M13507</link>
      <description>Hi, MarcTC.&lt;BR /&gt;
for qustion 2;&lt;BR /&gt;
you can specify 'format (var);'&lt;BR /&gt;
here's a example.&lt;BR /&gt;
data test;&lt;BR /&gt;
input a @@;&lt;BR /&gt;
format a dollar5.1;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 2 3&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc print;&lt;BR /&gt;
run;&lt;BR /&gt;
data akari;&lt;BR /&gt;
set test;&lt;BR /&gt;
format a;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 13 Jan 2011 07:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62054#M13507</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-13T07:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62055#M13508</link>
      <description>Decoding a user-defined SAS format: check the PROC FORMAT documentation, you have either CNTLOUT= (then PROC PRINT) or more simply you can use FMTLIB to print the contents of a SAS format.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
proc format fmtlib site:sas.com</description>
      <pubDate>Thu, 13 Jan 2011 13:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62055#M13508</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-01-13T13:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62056#M13509</link>
      <description>&amp;gt; What is F10.4 format? I can't find any web page in&lt;BR /&gt;
&amp;gt; SAS explaining this format.&lt;BR /&gt;
&lt;BR /&gt;
It appears that F is the name of the format most know as w.d&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
203  data _null_;&lt;BR /&gt;
204     x = 1;&lt;BR /&gt;
205     format x 10.4;&lt;BR /&gt;
206     format = vformat(x);&lt;BR /&gt;
207     put 'NOTE: ' format=;&lt;BR /&gt;
208     run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: format=F10.4&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 13 Jan 2011 14:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62056#M13509</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-01-13T14:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62057#M13510</link>
      <description>Hi:&lt;BR /&gt;
  As it shows here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000199377.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000199377.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
The "F" format is an alias for the simple w.d (width/decimal) that can be applied to numeric variables.&lt;BR /&gt;
 &lt;BR /&gt;
  The whole list of formats by category is here:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a001263753.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a001263753.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
  To see a list of all the user-defined formats (or selected ones) stored in a format library, use the FMTLIB option with PROC FORMAT:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473464.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473464.htm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 13 Jan 2011 14:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62057#M13510</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-13T14:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62058#M13511</link>
      <description>I only have a SAS dataset, no original Catalog which created the user-defined formats used in the dataset. Isn't FMTLIB only applied for Catalog only?&lt;BR /&gt;
&lt;BR /&gt;
Here is a more detailed description about my dataset:&lt;BR /&gt;
&lt;BR /&gt;
The data looks like:&lt;BR /&gt;
&lt;BR /&gt;
Student  Rank&lt;BR /&gt;
Tom      Top 10&lt;BR /&gt;
Mary     Top 20&lt;BR /&gt;
Joe      Top 10&lt;BR /&gt;
Nancy    Top 30&lt;BR /&gt;
&lt;BR /&gt;
Rank is a numeric variable, but associated with a user-defined format. That is why you see those strings Top 10, Top 20.. when viewing the dataset. I want to know what are the underlying numeric values corresponding to each string. That is what I meant by "decoding a format".</description>
      <pubDate>Thu, 13 Jan 2011 17:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62058#M13511</guid>
      <dc:creator>MarcTC</dc:creator>
      <dc:date>2011-01-13T17:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62059#M13512</link>
      <description>Ah, that's not how I interpreted "decode". To "remove" a user-defined format for the purpose of running a report, you can use a NULL format statement, such as shown below. Basically, you list the variable on a FORMAT statement and then do NOT put a format name after the variable name.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc print data=mydata;&lt;BR /&gt;
format rank;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 13 Jan 2011 18:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62059#M13512</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-13T18:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62060#M13513</link>
      <description>Hmm...you still don't get what I mean.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Suppose:&lt;BR /&gt;
&lt;BR /&gt;
Rank=1 =&amp;gt; being formated as "Top 10"&lt;BR /&gt;
Rnak=2 =&amp;gt; being formated as "Top 20"&lt;BR /&gt;
Rank=3 =&amp;gt; being formated as "Top 30"&lt;BR /&gt;
....&lt;BR /&gt;
&lt;BR /&gt;
I want to find out this relationship/mapping.</description>
      <pubDate>Thu, 13 Jan 2011 18:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62060#M13513</guid>
      <dc:creator>MarcTC</dc:creator>
      <dc:date>2011-01-13T18:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62061#M13514</link>
      <description>That's what FMTLIB does -- it shows the mapping from the values to the label. If the FMTLIB is being used when you do a PROC PRINT (and the format shows up in a PROC CONTENTS), then FMTLIB will show the mapping, not exactly in the form you show, but close enough.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 13 Jan 2011 19:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62061#M13514</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-13T19:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62062#M13515</link>
      <description>You are smarter and can read the SAS syntax page.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I tried several different combinations and nothing works. One of them is:&lt;BR /&gt;
&lt;BR /&gt;
proc format library=work.mydataset fmtlib;&lt;BR /&gt;
select $rank;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 13 Jan 2011 19:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62062#M13515</guid>
      <dc:creator>MarcTC</dc:creator>
      <dc:date>2011-01-13T19:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62063#M13516</link>
      <description>Hi:&lt;BR /&gt;
&lt;BR /&gt;
  OK..for your SAS dataset. If you run PROC CONTENTS, do you see that $RANK is listed as the format???&lt;BR /&gt;
 &lt;BR /&gt;
  If yes, then try:&lt;BR /&gt;
library=library or&lt;BR /&gt;
library=work&lt;BR /&gt;
 &lt;BR /&gt;
in your PROC FORMAT statement. The chances are good that your folks who built the format took the default and stored the user defined format in a format catalog called "LIBRARY" or in "WORK" -- I know, it seems redundant to have LIBRARY=LIBRARY, but that's one of  the "simple" ways that folks have defined their own format catalogs over the years.&lt;BR /&gt;
 &lt;BR /&gt;
You cannot put your dataset name in the LIBRARY= option.&lt;BR /&gt;
 &lt;BR /&gt;
If you run a PROC CONTENTS and do NOT see $RANK listed as the format being used for the field, then it is probable that the format used to create the RANK variable might not be available to you.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 13 Jan 2011 19:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62063#M13516</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-13T19:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62064#M13517</link>
      <description>Shouldn't the OP be looking for the numeric format RANK much rather?&lt;BR /&gt;
&lt;BR /&gt;
I.e.&lt;BR /&gt;
&lt;BR /&gt;
....&lt;BR /&gt;
  select rank ;</description>
      <pubDate>Fri, 14 Jan 2011 07:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62064#M13517</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2011-01-14T07:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62065#M13518</link>
      <description>A PROC CONTENTS should tell him whether the format is character or numeric and whether there is a format in current use. That's why I keep asking whether he's run PROC CONTENTS.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 14 Jan 2011 14:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62065#M13518</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-01-14T14:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Format questions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62066#M13519</link>
      <description>Hi.&lt;BR /&gt;
proc format + cnlout option to output the format contents into a dataset.&lt;BR /&gt;
I remember it has mentioned by Art C at before post.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Mon, 17 Jan 2011 03:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Format-questions/m-p/62066#M13519</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-01-17T03:10:50Z</dc:date>
    </item>
  </channel>
</rss>

