<?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: Import pre-stored format table in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700721#M25731</link>
    <description>&lt;P&gt;Proc contents says "STATEDESIGNATION" is a character variable with format $1. and Informat $1 (type="I") should be ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The format dataset says values are I, II, III, IV etc...&lt;/P&gt;&lt;P&gt;However, in my dataset, it looks like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence my need to try applying the formats to get all hospital levels as I, II, III and so on. Maybe i'm wrong ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Dec 2020 19:07:46 GMT</pubDate>
    <dc:creator>malls</dc:creator>
    <dc:date>2020-12-15T19:07:46Z</dc:date>
    <item>
      <title>Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700689#M25723</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recently received a dataset with formats separated in another table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would really like any help on how to import/link these formats to my dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 14:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700689#M25723</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2020-11-21T14:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700691#M25724</link>
      <description>&lt;P&gt;These tables should be in the CNTLIN layout as found in the documentation of PROC FORMAT,&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=proc&amp;amp;docsetTarget=p0owa4ftikc2ekn1q0rmpulg86cx.htm&amp;amp;locale=en#p05g1cdvff8h8tn1frtzxrnkzezo" target="_blank" rel="noopener"&gt;Input Control Dataset&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If yes, just run PROC FORMAT with the CNTLIN option.&lt;/P&gt;
&lt;P&gt;If no, please show us an example for those tables, so we can suggest a way to turn them into formats.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 15:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700691#M25724</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-21T15:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700704#M25725</link>
      <description>&lt;P&gt;Thank you for this quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 19:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700704#M25725</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2020-12-15T19:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700706#M25726</link>
      <description>&lt;P&gt;The minimum of columns you need in a CNTLIN datasets are these:&lt;/P&gt;
&lt;P&gt;FMTNAME&lt;/P&gt;
&lt;P&gt;TYPE N or C&lt;/P&gt;
&lt;P&gt;START value to be formatted&lt;/P&gt;
&lt;P&gt;LABEL formatted value&lt;/P&gt;
&lt;P&gt;and if you need to mark a label for "other"&lt;/P&gt;
&lt;P&gt;HLO&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Length is not important (will be automatically assumed from the maximum LABEL length)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, VALUE needs to be renamed to START, and a TYPE column added; the value of this can be deducted from the contents of START, and the types of the variable where the format is used.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 19:23:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700706#M25726</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-21T19:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700709#M25727</link>
      <description>&lt;P&gt;Awesome.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The CNTLIN worked.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="malls_0-1605989330424.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51905i53B4669BDB3A247A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="malls_0-1605989330424.png" alt="malls_0-1605989330424.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, once i apply it to the data, i still got these values (I, N, O) to the variable "statedesignation" instead of values (I, II, III, IV etc...). I sure missed something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 20:09:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700709#M25727</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2020-11-21T20:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700710#M25728</link>
      <description>&lt;P&gt;Run a PROC CONTENTS on the dataset (that with the data, not the CNTLIN) to see which type the variable is and which format is assigned to it.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 20:13:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700710#M25728</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-21T20:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700711#M25729</link>
      <description>&lt;P&gt;Your log says that all formats were created as informats (type = "I"). Make sure that the TYPE is correctly set for the later use.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 20:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700711#M25729</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-21T20:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700714#M25730</link>
      <description>&lt;P&gt;The TYPE is not required.&amp;nbsp; It will default to numeric format, unless the FTMNAME starts with a $ then it will define a character format.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Nov 2020 21:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700714#M25730</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-21T21:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700721#M25731</link>
      <description>&lt;P&gt;Proc contents says "STATEDESIGNATION" is a character variable with format $1. and Informat $1 (type="I") should be ok.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The format dataset says values are I, II, III, IV etc...&lt;/P&gt;&lt;P&gt;However, in my dataset, it looks like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence my need to try applying the formats to get all hospital levels as I, II, III and so on. Maybe i'm wrong ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 19:07:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700721#M25731</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2020-12-15T19:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700725#M25732</link>
      <description>&lt;P&gt;The $ format does nothing to the values (other than possibly truncating them if the width is less than the length of the variable).&amp;nbsp; The informat attached to a variable is of no consequence once the variable values are already in the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if&amp;nbsp;&lt;SPAN&gt;STATEDESIGNATION is using the $1. format to display its values the what you will see in the report is actual values (since it looks like the length is also only 1).&amp;nbsp; &amp;nbsp;Your&amp;nbsp;report is showing values of 'I', 'N' and 'O' plus a lot of blank values which were treated as missing.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you have defined a format that converts those values in strings like 'I', 'II', 'III' then you need to make sure to use that format with the variable when you run the report.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So something like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
value $decode 'I'='I' 'N'='II' 'O'='III' ;
run;
proc freq ;
  tables STATEDESIGNATION ;
  format STATEDESIGNATION  $decode. ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Nov 2020 04:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700725#M25732</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-22T04:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700729#M25733</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The TYPE is not required.&amp;nbsp; It will default to numeric format, unless the FTMNAME starts with a $ then it will define a character format.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You are of course right about that, but there is at least one format in there that expects a character variable (the bottom one in the screenshot), and no FMTNAME has a $ in it; so we need to set the TYPE for those to "C", or add the dollar sign in the name.&lt;BR /&gt;Anyway, there must be a TYPE already in the dataset, containing all I's , or the FORMAT procedure would not have created all those &lt;STRONG&gt;in&lt;/STRONG&gt;formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/234343"&gt;@malls&lt;/a&gt;&amp;nbsp;&lt;STRONG&gt;In&lt;/STRONG&gt;formats are only needed when reading data from external sources (text files), they do not influence how values are displayed. For that you need &lt;EM&gt;formats&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;If you can't fix your issues with all the suggestions we already provided, we need to get an example for the "format" dataset that contains all columns and examples for their contents; this is best done by posting a data step with datalines. The macro linked in my footnotes can convert a dataset to such data step code.&lt;/P&gt;
&lt;P&gt;Your PROC CONTENTS output reveals that no formats are assigned to the columns, you will need to do that yourself; a documentation linking formats to columns would come in handy. Setting the formats can be done with PROC DATASETS, so you do not need to rewrite the whole dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Nov 2020 08:13:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700729#M25733</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-22T08:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700763#M25734</link>
      <description>&lt;P&gt;Here is the information provided in the user manual :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The format dataset looks like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the data step i applied to the format data set :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA fmtDataset;&lt;BR /&gt;SET formats;&lt;BR /&gt;RETAIN fmtname "$fmtsatedesignation" type = "I";&lt;BR /&gt;RENAME Value = Start;&lt;BR /&gt;run;&lt;BR /&gt;PROC FORMAT CNTLIN=fmtDataset;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;proc contents data=kmus.trauma;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an example of the proc contents result :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you,&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 19:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700763#M25734</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2020-12-15T19:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700768#M25735</link>
      <description>&lt;P&gt;Why did you use a TYPE of "I"? That causes all the formats to become informats and be useless.&lt;/P&gt;
&lt;P&gt;Since all formats seem to be numeric anyway, no TYPE is needed (see &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;), you can remove the RETAIN statement completely (FMTNAME is already contained in the dataset).&lt;/P&gt;</description>
      <pubDate>Sun, 22 Nov 2020 17:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700768#M25735</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-22T17:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700918#M25745</link>
      <description>&lt;P&gt;Looks like you defined the variables in your dataset as character instead of numeric.&amp;nbsp; So use TYPE='C' in your CNTLIN dataset.&lt;/P&gt;
&lt;P&gt;Also the handling of the missing values in VALUE column in the FORMAT dataset should be character.&amp;nbsp; From the way it is posing in the photograph you posted it appears that it is currently defined as numeric.&amp;nbsp; Did you make that dataset from a CSV file? If so make sure to read the field as character, not numeric.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 17:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700918#M25745</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-23T17:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700942#M25746</link>
      <description>&lt;P&gt;In which format did you get/download the datasets? As .sas7bdat files, or as .csv files you then imported?&lt;/P&gt;
&lt;P&gt;And if the latter, how did you import them?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 15:54:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/700942#M25746</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-23T15:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/701228#M25756</link>
      <description>&lt;P&gt;My format table is .csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code iused to import this table :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc import datafile='E:\PUF AY 2017\PUF AY 2017\CSV\PUF_FORMATS.csv'&lt;BR /&gt;out=kmus.FORMATS dbms=csv replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Further, i submitted these codes :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data formats;&lt;BR /&gt;set kmus.formats;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;DATA fmtDataset;&lt;BR /&gt;SET formats;&lt;BR /&gt;RENAME Value = Start;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PROC FORMAT CNTLIN=fmtDataset type="C";&lt;BR /&gt;RUN;&lt;BR /&gt;data test; set dixsept;&lt;BR /&gt;format statedesignation statedesignation.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc freq data=test;&lt;BR /&gt;table statedesignation;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sadly, i still get missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 14:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/701228#M25756</guid>
      <dc:creator>malls</dc:creator>
      <dc:date>2020-11-24T14:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Import pre-stored format table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/701242#M25757</link>
      <description>&lt;P&gt;Don't use PROC IMPORT to read CSV files.&amp;nbsp; It has to GUESS how to define the variables. Just write your own data step to read the CSV file and then you can control how the variables are defined.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2020 15:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-pre-stored-format-table/m-p/701242#M25757</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-24T15:09:53Z</dc:date>
    </item>
  </channel>
</rss>

