<?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 reading data file with formats defined but not format file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/reading-data-file-with-formats-defined-but-not-format-file/m-p/816376#M322220</link>
    <description>&lt;P&gt;A co-worker read in multiple csv files using a data-infile command and defined an informat and a format statement for each variable, e.g., best12., best32. for numerics. Each file included numeric, string, and date-time variables. Files were concantenated and an spss data file was read and matched to the csv files. Processing ensued and a data file was saved. Now, i wish to read that created file but i get errors:&lt;/P&gt;&lt;P&gt;ERROR: The format $MS_CLI was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL1A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL2A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL3A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL4A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL5A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format MS_STAT was not found or could not be loaded.&lt;BR /&gt;ERROR: The format EMASTUD was not found or could not be loaded.&lt;BR /&gt;ERROR: The format EMAPHON was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;From reading Cody's book, i believe that a format file is missing/was not saved.&lt;/P&gt;&lt;P&gt;I'd like to know several things.&lt;/P&gt;&lt;P&gt;1) Is there a method/scheme to get sas to read the current data file? If yes, how.&lt;/P&gt;&lt;P&gt;2) Did the co-worker, an experienced, long-time sas user need to specify formats and informats?&lt;/P&gt;&lt;P&gt;3) The above error messages refer to specific formats; however, when i search for that format in the syntax file, i do not find those names. Conversely, why are no error messages noted for the Bestw., $w, and date-timew formats? How do i understand this?&lt;/P&gt;&lt;P&gt;Thanks, Gene Maguin&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 18:10:58 GMT</pubDate>
    <dc:creator>emaguin</dc:creator>
    <dc:date>2022-06-03T18:10:58Z</dc:date>
    <item>
      <title>reading data file with formats defined but not format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-data-file-with-formats-defined-but-not-format-file/m-p/816376#M322220</link>
      <description>&lt;P&gt;A co-worker read in multiple csv files using a data-infile command and defined an informat and a format statement for each variable, e.g., best12., best32. for numerics. Each file included numeric, string, and date-time variables. Files were concantenated and an spss data file was read and matched to the csv files. Processing ensued and a data file was saved. Now, i wish to read that created file but i get errors:&lt;/P&gt;&lt;P&gt;ERROR: The format $MS_CLI was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL1A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL2A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL3A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL4A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format $MS_CL5A was not found or could not be loaded.&lt;BR /&gt;ERROR: The format MS_STAT was not found or could not be loaded.&lt;BR /&gt;ERROR: The format EMASTUD was not found or could not be loaded.&lt;BR /&gt;ERROR: The format EMAPHON was not found or could not be loaded.&lt;/P&gt;&lt;P&gt;From reading Cody's book, i believe that a format file is missing/was not saved.&lt;/P&gt;&lt;P&gt;I'd like to know several things.&lt;/P&gt;&lt;P&gt;1) Is there a method/scheme to get sas to read the current data file? If yes, how.&lt;/P&gt;&lt;P&gt;2) Did the co-worker, an experienced, long-time sas user need to specify formats and informats?&lt;/P&gt;&lt;P&gt;3) The above error messages refer to specific formats; however, when i search for that format in the syntax file, i do not find those names. Conversely, why are no error messages noted for the Bestw., $w, and date-timew formats? How do i understand this?&lt;/P&gt;&lt;P&gt;Thanks, Gene Maguin&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 18:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-data-file-with-formats-defined-but-not-format-file/m-p/816376#M322220</guid>
      <dc:creator>emaguin</dc:creator>
      <dc:date>2022-06-03T18:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: reading data file with formats defined but not format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-data-file-with-formats-defined-but-not-format-file/m-p/816382#M322224</link>
      <description>&lt;P&gt;The missing formats are custom formats created by SAS user. Formats provided by the SAS software (like BEST) are always available.&lt;/P&gt;
&lt;P&gt;Run this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nofmterr;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;so you can view the dataset to see the raw, unformatted values.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 18:39:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-data-file-with-formats-defined-but-not-format-file/m-p/816382#M322224</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-06-03T18:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: reading data file with formats defined but not format file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/reading-data-file-with-formats-defined-but-not-format-file/m-p/816387#M322227</link>
      <description>&lt;P&gt;BEST, $, DATE etc formats are part of the BASE SAS installation. So you do not need to define them to use them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First thing to try is to tell SAS that it is not an ERROR if the format cannot be found, then you can at least look at the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nofmterr;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do you have the formats saved somewhere?&amp;nbsp; Perhaps you just need to tell SAS where to find them.&amp;nbsp; Modify the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lesysoptsref/p1fvn6rwmpf1njn1whkud1hmsc97.htm" target="_self"&gt;FMTSEARCH option&lt;/A&gt;.&amp;nbsp; Either directly set it or use the APPEND= or INSERT= option to add a new catalog to the current list of catalogs to search.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most likely source of those formats was the conversion of the SPSS file into a SAS dataset.&amp;nbsp; The SPSS file probably had "data labels" and those were translated into user defined formats and the formats were attached to the variables.&amp;nbsp; When you later combined the data from SPSS with the data from the CSV file you did not bother to remove the format from the variables.&amp;nbsp; You probably do not need all of those formats. If the variables MS_CLI... use the same set of codes then you can probably use one format to decode all of them.&amp;nbsp; Or perhaps the coded values are meaningful enough that you do not need to see the decoded values to work with the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most likely if you re-convert the SPSS file into a SAS dataset you will get the formats defined again. This time either change the options used so that the formats are written to a permanent catalog instead of a WORK catalog or copy the formats from the WORK.FORMATS catalog into a permanent catalog that you can use in the future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note there is normally no reason to attach formats or informats to variables read from a CSV file.&amp;nbsp; You do not need them with normal numbers or strings, so not need for the BEST or $ formats to be attached.&amp;nbsp; (NOTE A lot of novice coders think that attaching a FORMAT or an INFORMAT to a variable somehow is defining the variable.&amp;nbsp; Those statements will only define the variable as side effect when the variable was not previously defined. Use the LENGTH statement to DEFINE the variables).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attach formats to variables whose values you want to display in a special way.&amp;nbsp; Like DATE, TIME or DATETIME values that just look like random numbers to humans if not formatted.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly for reading the text in the CSV into values you do not usually need to specify any informat. (Again DATE, TIME and DATETIME values are normally the exception).&amp;nbsp; And even if you did need to use an informat when reading the value you could include it in the INPUT statement instead of permanently attaching it to the variable.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 18:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/reading-data-file-with-formats-defined-but-not-format-file/m-p/816387#M322227</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-03T18:51:16Z</dc:date>
    </item>
  </channel>
</rss>

