<?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 why is the proc print format showing error, for example 3.8 in R. Cody learning SAS by example? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770967#M30918</link>
    <description>&lt;P&gt;the data step:&lt;/P&gt;&lt;P&gt;data Financial;&lt;BR /&gt;infile 'C:\books\learning\Bank.txt';&lt;BR /&gt;input Subj $ 1-3 DOB $ 4-13 Gender $ 14 Balance 15-21;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;and 3.8 below follows on the data step for reading raw data from fixed columns:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Program 3.8: Demonstrating a FORMAT Statement&lt;BR /&gt;title "Listing of Financial";&lt;BR /&gt;proc print data=Financial;&lt;BR /&gt;format DOB mmddyy10.&lt;BR /&gt;Balance dollar11.2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;produce error:&lt;/P&gt;&lt;P&gt;ERROR: You are trying to use the character format $ with the numeric variable Gender in data set&lt;BR /&gt;WORK.FINANCIAL&lt;BR /&gt;I appreciate your feedback&lt;/P&gt;</description>
    <pubDate>Tue, 28 Sep 2021 17:40:28 GMT</pubDate>
    <dc:creator>DJ3</dc:creator>
    <dc:date>2021-09-28T17:40:28Z</dc:date>
    <item>
      <title>why is the proc print format showing error, for example 3.8 in R. Cody learning SAS by example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770967#M30918</link>
      <description>&lt;P&gt;the data step:&lt;/P&gt;&lt;P&gt;data Financial;&lt;BR /&gt;infile 'C:\books\learning\Bank.txt';&lt;BR /&gt;input Subj $ 1-3 DOB $ 4-13 Gender $ 14 Balance 15-21;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;and 3.8 below follows on the data step for reading raw data from fixed columns:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Program 3.8: Demonstrating a FORMAT Statement&lt;BR /&gt;title "Listing of Financial";&lt;BR /&gt;proc print data=Financial;&lt;BR /&gt;format DOB mmddyy10.&lt;BR /&gt;Balance dollar11.2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;produce error:&lt;/P&gt;&lt;P&gt;ERROR: You are trying to use the character format $ with the numeric variable Gender in data set&lt;BR /&gt;WORK.FINANCIAL&lt;BR /&gt;I appreciate your feedback&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 17:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770967#M30918</guid>
      <dc:creator>DJ3</dc:creator>
      <dc:date>2021-09-28T17:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: why is the proc print format showing error, for example 3.8 in R. Cody learning SAS by example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770970#M30919</link>
      <description>ERROR: You are trying to use the character format $ with the numeric variable Gender in data set&lt;BR /&gt;&lt;BR /&gt;You read in DOB as a character variable, since you included the $ sign in the INPUT statement. This means you cannot apply a date format, because that requires a numeric value. You need to modify your first data step to appropriately read the DOB as a date or you need to convert it first before applying the SAS format.</description>
      <pubDate>Tue, 28 Sep 2021 17:45:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770970#M30919</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-28T17:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: why is the proc print format showing error, for example 3.8 in R. Cody learning SAS by example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770973#M30920</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252615"&gt;@DJ3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;the data step:&lt;/P&gt;
&lt;P&gt;data Financial;&lt;BR /&gt;infile 'C:\books\learning\Bank.txt';&lt;BR /&gt;input Subj $ 1-3 DOB $ 4-13 Gender $ 14 Balance 15-21;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;and 3.8 below follows on the data step for reading raw data from fixed columns:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Program 3.8: Demonstrating a FORMAT Statement&lt;BR /&gt;title "Listing of Financial";&lt;BR /&gt;proc print data=Financial;&lt;BR /&gt;format DOB mmddyy10.&lt;BR /&gt;Balance dollar11.2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;produce error:&lt;/P&gt;
&lt;P&gt;ERROR: You are trying to use the character format $ with the numeric variable Gender in data set&lt;BR /&gt;WORK.FINANCIAL&lt;BR /&gt;I appreciate your feedback&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please post the full code and log in readable form.&lt;/P&gt;
&lt;P&gt;The code you have posted won't create the error message, because you have no statement assigning a format to the variable "Gender".&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 17:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770973#M30920</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-09-28T17:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: why is the proc print format showing error, for example 3.8 in R. Cody learning SAS by example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770976#M30921</link>
      <description>&lt;P&gt;I appreciate the feedback from all.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I introduce the DOB format in the input and run the code.&amp;nbsp; it worked fine, no error:&lt;/P&gt;&lt;P&gt;data financial;&lt;BR /&gt;infile 'V:\Examples\learning\Bank.txt';&lt;BR /&gt;input subj $ 1 - 3&lt;BR /&gt;@4 DOB mmddyy10.&lt;BR /&gt;Gender $ 14&lt;BR /&gt;Balance 15 -21;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=Financial;&lt;BR /&gt;format DOB mmddyy10.&lt;BR /&gt;Balance dollar11.2;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;this worked.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 18:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770976#M30921</guid>
      <dc:creator>DJ3</dc:creator>
      <dc:date>2021-09-28T18:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: why is the proc print format showing error, for example 3.8 in R. Cody learning SAS by example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770977#M30922</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Financial;
infile 'C:\books\learning\Bank.txt';
informat DOB mmddyy10.;
input Subj $ 1-3 DOB  4-13 Gender $ 14 Balance 15-21;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;OL&gt;
&lt;LI&gt;Add an INFORMAT statement for DOB that specifies how it is displayed in the text file. This tells SAS how the date should be read in. SAS will then read in the date and convert it to a SAS date, which is numeric and represents the number of day from January 1, 1960.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Remove the $ in the INPUT statement by DOB to tell SAS to read it in as numeric value, not character&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Then try printing it and applying a format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/252615"&gt;@DJ3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;the data step:&lt;/P&gt;
&lt;P&gt;data Financial;&lt;BR /&gt;infile 'C:\books\learning\Bank.txt';&lt;BR /&gt;input Subj $ 1-3 DOB $ 4-13 Gender $ 14 Balance 15-21;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;and 3.8 below follows on the data step for reading raw data from fixed columns:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Program 3.8: Demonstrating a FORMAT Statement&lt;BR /&gt;title "Listing of Financial";&lt;BR /&gt;proc print data=Financial;&lt;BR /&gt;format DOB mmddyy10.&lt;BR /&gt;Balance dollar11.2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;produce error:&lt;/P&gt;
&lt;P&gt;ERROR: You are trying to use the character format $ with the numeric variable Gender in data set&lt;BR /&gt;WORK.FINANCIAL&lt;BR /&gt;I appreciate your feedback&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 18:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770977#M30922</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-28T18:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: why is the proc print format showing error, for example 3.8 in R. Cody learning SAS by example?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770978#M30923</link>
      <description>Please mark the question as answered as you know have a solution.</description>
      <pubDate>Tue, 28 Sep 2021 18:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/why-is-the-proc-print-format-showing-error-for-example-3-8-in-R/m-p/770978#M30923</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-28T18:03:30Z</dc:date>
    </item>
  </channel>
</rss>

