<?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: Informats and Formats assigned when non are specified in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603428#M16948</link>
    <description>&lt;P&gt;What formats are attached to those variables in the source datasets?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;HypImpt.Vit_IA
HypImpt.Mississippi_VS
HypImpt.utah_vitals:&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Nov 2019 04:43:37 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-11-12T04:43:37Z</dc:date>
    <item>
      <title>Informats and Formats assigned when non are specified</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603426#M16947</link>
      <description>&lt;P&gt;When I run this code, SAS is automatically assigning formats and informats to all of my data when I only want a format on my date variable. Am I accidentally creating these formats and informats or I am missing something? Is there any way that I can get SAS to stop creating these Formats and Informats? I have copied the formats that I keep getting below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*	Creating data for Iowa   *;
DATA	WORK.Vitals_IA ;
	HtIn = HtCm * 2.54;
	WtLb = WtKg * .454;
	DROP HtCm WtKg;
	SET	HypImpt.Vit_IA (RENAME = (SSN = FedData));
	SSN = PUT(FedData, 11.);
	DROP FedData;
	RUN;

*	Creating data for Mississippi   *;
DATA	WORK.Vitals_MS (RENAME = (VisitDate = VisitDt Height = HtIn Weight = WtLb));
	SET	HypImpt.Mississippi_VS;

	RUN;

*	Creating data for Utah   *;
DATA	WORK.Vitals_UT;
	LENGTH SSN $11.
		   pt1 $3.
		   pt2 $2.
		   pt3 $4.;
	SET HypImpt.utah_vitals: (RENAME = (ApptDate = VisitDt));
	IDs = STRIP(SSN);
		pt1 = substr(IDs,1,3);
		pt2 = substr(IDs,4,2);
		pt3 = substr(IDs,6,4);
	SSN = CATX('-', pt1, pt2, pt3);
	RUN;

PROC TRANSPOSE	
		DATA = WORK.Vitals_UT
		OUT = WORK.Vitals_UT2 (DROP = _NAME_ _LABEL_ RENAME = (Col1 = HtIn Col2 = WtLb Col3 = SBP Col4 = DBP));
	VAR Value;
	BY VisitDt SSN;
	RUN;
	

*	Creating Combined Data Set   *;


DATA	HypTabs.Vitals (LABEL = Vital Signs);

	ATTRIB SSN LABEL= 'Social Security Number' LENGTH = $11.
		   VisitDt LABEL= 'Visit Date' LENGTH = 8. FORMAT = DATE9.
		   HtIn LABEL = 'Height (In)' LENGTH = 8.
		   WtLb LABEL= 'Weight (Lb)' LENGTH = 8.
		   SBP LABEL= 'Systolic BP (mmHg)' LENGTH = 8.
		   DBP LABEL= 'Diastolic BP (mmHg)' LENGTH = 8.;
	KEEP SSN VisitDt HtIn WtLb SBP DBP;

	SET	WORK.Vitals_IA
		WORK.Vitals_MS
		WORK.Vitals_UT2;

	

	RUN;


PROC SORT DATA= HypTabs.Vitals;
	BY SSN VisitDt;
RUN;

PROC CONTENTS DATA= HypTabs.Vitals VARNUM;
RUN;

PROC PRINT DATA= HypTabs.Vitals (obs=1);
RUN;&lt;/CODE&gt;&lt;/PRE&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;&lt;P&gt;Variables in Creation Order# Variable Type Len Format Informat Label123456&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SSN&lt;/TD&gt;&lt;TD&gt;Char&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;$9.&lt;/TD&gt;&lt;TD&gt;$9.&lt;/TD&gt;&lt;TD&gt;Social Security Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;VisitDt&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;DATE9.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Visit Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;HtIn&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;BEST.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Height (In)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;WtLb&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;BEST.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Weight (Lb)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SBP&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;BEST12.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Systolic BP (mmHg)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DBP&lt;/TD&gt;&lt;TD&gt;Num&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;BEST12.&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Diastolic BP (mmHg)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 12 Nov 2019 04:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603426#M16947</guid>
      <dc:creator>walkerel</dc:creator>
      <dc:date>2019-11-12T04:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Informats and Formats assigned when non are specified</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603428#M16948</link>
      <description>&lt;P&gt;What formats are attached to those variables in the source datasets?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;HypImpt.Vit_IA
HypImpt.Mississippi_VS
HypImpt.utah_vitals:&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Nov 2019 04:43:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603428#M16948</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-12T04:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Informats and Formats assigned when non are specified</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603429#M16949</link>
      <description>&lt;P&gt;None. Before I start manipulating anything, there are no formats or informats attached to the data.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 04:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603429#M16949</guid>
      <dc:creator>walkerel</dc:creator>
      <dc:date>2019-11-12T04:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Informats and Formats assigned when non are specified</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603432#M16951</link>
      <description>It seems as though the formats are all stemming from when I create my vitals_ut data from what I am seeing when I run the steps individually.</description>
      <pubDate>Tue, 12 Nov 2019 05:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603432#M16951</guid>
      <dc:creator>walkerel</dc:creator>
      <dc:date>2019-11-12T05:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Informats and Formats assigned when non are specified</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603433#M16952</link>
      <description>&lt;P&gt;That is the step where you are reading in an unknown number of inputs because you are using the colon wildcard in the list of dataset on the SET statement. So you need to check all of them to see whether any of them have a format attached to the variables you are interested in.&amp;nbsp; When you combine multiple datasets SAS will pick the first non missing format for each variable.&amp;nbsp; So you just cannot check the first dataset because if the variable has no format attached in the first dataset, but does in the second dataset then the result will be to use the format that the variable had in the second dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To remove the formats just add a format statement that lists variable, but has no format specification, to your data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format visitdt date9. ssn HtIn WtLb SBP DBP ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Nov 2019 05:07:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Informats-and-Formats-assigned-when-non-are-specified/m-p/603433#M16952</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-11-12T05:07:10Z</dc:date>
    </item>
  </channel>
</rss>

