<?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: Level 2 Practice: Using Procedures to Validate Data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522412#M4433</link>
    <description>&lt;P&gt;Hi Cynthia,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have provided the further details for the clarification.But my question is not with the coding as I wrote the code right and got the result as mentioned in the solutions only.&lt;/P&gt;&lt;P&gt;However my question is that How we will find the invalid values. Like in the result we got three invalid values, So, my question is how are they invalid.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aakarshan&lt;/P&gt;</description>
    <pubDate>Wed, 19 Dec 2018 02:35:18 GMT</pubDate>
    <dc:creator>Aakarshan</dc:creator>
    <dc:date>2018-12-19T02:35:18Z</dc:date>
    <item>
      <title>Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522397#M4426</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a little clarification and understanding on valid and invalid values while using PROC statements.&lt;/P&gt;&lt;P&gt;For instance in Level 2 practice :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How&lt;/STRONG&gt; "&amp;nbsp;&lt;EM&gt;NPRE&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;PRESERVE&lt;/EM&gt;&lt;SPAN&gt;, and&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;RIVERWAYS&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;are invalid values for&amp;nbsp;&lt;/SPAN&gt;Type&lt;SPAN&gt;." becomes the invalid values existing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please explain.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Aakarshan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 00:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522397#M4426</guid>
      <dc:creator>Aakarshan</dc:creator>
      <dc:date>2018-12-19T00:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522400#M4427</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/247925"&gt;@Aakarshan&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please do not assume that all the community members have access to your practice questions. Post the question entirely and ask for your clarification.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 01:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522400#M4427</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-12-19T01:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data [how to improve your question]</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522401#M4428</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/247925"&gt;@Aakarshan&lt;/a&gt;,&lt;/P&gt;&lt;BR /&gt; &lt;P&gt;Your question requires more details before experts can help.&amp;nbsp;Can you revise your question to include more information?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review this checklist:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Specify a meaningful subject line for your topic.&amp;nbsp; Avoid generic subjects like "need help," "SAS query," or "urgent."&lt;/LI&gt;
&lt;LI&gt;When appropriate, provide sample data in text or DATA step format.&amp;nbsp; See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;this article for one method&lt;/A&gt;&amp;nbsp;you can use.&lt;/LI&gt;
&lt;LI&gt;If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition.&amp;nbsp;Use the&amp;nbsp;&lt;STRONG&gt;Photos&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;button to include the image in your message.&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 279px;"&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/16608i91A52F817EAC9A69/image-dimensions/279x150?v=1.0" width="279" height="150" alt="use_buttons.png" title="use_buttons.png" /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;It also helps to include an example (table or picture) of the result that you're trying to achieve.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;To edit your original message, select the "blue gear" icon at the top of the message and select&amp;nbsp;&lt;STRONG&gt;Edit Message&lt;/STRONG&gt;.&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;From there you can adjust the title and add more details to the body of the message.&amp;nbsp; Or, simply reply to this message with any additional information you can supply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 229px;"&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/16605iAC020BC79315B045/image-size/large?v=1.0&amp;amp;px=600" alt="edit_post.png" title="edit_post.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;SAS experts are eager to help -- help&amp;nbsp;&lt;EM&gt;them&lt;/EM&gt; by providing as much detail as you can.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style:italic;font-size:smaller;"&gt;This prewritten response was triggered for you by fellow SAS Support Communities member &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;.</description>
      <pubDate>Wed, 19 Dec 2018 01:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522401#M4428</guid>
      <dc:creator>Community_Guide</dc:creator>
      <dc:date>2018-12-19T01:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522405#M4429</link>
      <description>&lt;P&gt;Sorry for the assumption , will post the new and detailed question.&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 01:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522405#M4429</guid>
      <dc:creator>Aakarshan</dc:creator>
      <dc:date>2018-12-19T01:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data [how to improve your question]</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522408#M4431</link>
      <description>&lt;P&gt;Level 2 Practice: Using Procedures to Validate Data&lt;/P&gt;&lt;P&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;pg1.np_summary&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table contains information about US national parks, monuments, preserves, rivers, and seashores. Valid values and descriptions for the columns&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Reg&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;are as follows:&lt;/P&gt;&lt;P&gt;Reg Description Type Description&lt;/P&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="4"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Alaska&lt;/TD&gt;&lt;TD&gt;NM&lt;/TD&gt;&lt;TD&gt;National Monument&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;IM&lt;/TD&gt;&lt;TD&gt;Intermountain&lt;/TD&gt;&lt;TD&gt;NP&lt;/TD&gt;&lt;TD&gt;National Park&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;MW&lt;/TD&gt;&lt;TD&gt;Midwest&lt;/TD&gt;&lt;TD&gt;NS&lt;/TD&gt;&lt;TD&gt;National Seashore&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NC&lt;/TD&gt;&lt;TD&gt;National Capital&lt;/TD&gt;&lt;TD&gt;PRE&lt;/TD&gt;&lt;TD&gt;National Preserve&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;NE&lt;/TD&gt;&lt;TD&gt;Northeast&lt;/TD&gt;&lt;TD&gt;RVR&lt;/TD&gt;&lt;TD&gt;National River&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PW&lt;/TD&gt;&lt;TD&gt;Pacific West&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SE&lt;/TD&gt;&lt;TD&gt;Southeast&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;STRONG&gt;Reminder&lt;/STRONG&gt;: If you restarted your SAS session,you must recreate the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PG1&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;library so you can access your practice files. In SAS Studio, open and submit the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;libname.sas&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;program in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;EPG194&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;folder. In Enterprise Guide, run the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Autoexec&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;process flow.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a new program.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Write a PROC FREQ step to produce frequency tables for the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Reg&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;columns in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;pg1.np_summary&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table.&lt;/LI&gt;&lt;LI&gt;Submit the step and look for invalid values.&lt;/LI&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;U&gt;What invalid values exist for&amp;nbsp;Reg?&lt;/U&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;U&gt;What invalid values exist for&amp;nbsp;Type?&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Write a PROC UNIVARIATE step to generate statistics for the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Acres&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;column in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;pg1.np_summary&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table. Submit the step.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;What are the observation numbers for the smallest park and the largest park?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;View the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;pg1.np_summary&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;table to identify the name and size of the smallest and largest parks.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above highlighted and underlined point 2 and point 3. I need an explanation on that.&lt;/P&gt;&lt;P&gt;Coding is understood but Need an explanation as why and how "&lt;EM&gt;NPRE&lt;/EM&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;PRESERVE&lt;/EM&gt;&lt;SPAN&gt;, and&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;RIVERWAYS&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;are invalid values for&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Type&lt;/STRONG&gt;&lt;SPAN&gt;."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope I have made myself clear for the community people to understand my query now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also attaching the codes used&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*NPRE, PRESERVE, and RIVERWAYS are invalid values for Type. and
No invalid values exist for Reg.*/
proc freq data= pg1.np_summary;
tables reg type ;
run;

/*Smallest: Observation 78
Largest: Observation 6*/
proc univariate data= pg1.np_summary;
var Acres ;
run;



/*Smallest: African Burial Ground Monument, .35 acres
Largest: Noatak National Preserve, 6,587,071.39 acres*/
proc print data=pg1.np_summary;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your detailed information with the steps.&lt;/P&gt;&lt;P&gt;Aakarshan&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:05:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522408#M4431</guid>
      <dc:creator>Aakarshan</dc:creator>
      <dc:date>2018-12-19T02:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522410#M4432</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt;&amp;nbsp; It looks like you are in the Programming 1 class, in a Level 2 Practice. Each practice has a solution for you to look at. Please click the "Show Solution" button at the bottom of the Practice window.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; If seeing the solution does NOT answer your question, then please revisit the videos in the lesson that is immediately before the practice. Most of the tasks or code required in a practice is either shown in the lecture or discussed in one of the demos in the section that is immediately before your practice.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; Please remember that many people on these Forums have already taken Programming 1 in the past. They may or may not be familiar with our newest version of Programming 1. It always helps to state the following information if you are working inside an e-learning class:&lt;/P&gt;
&lt;P&gt;1) the name of the class&lt;/P&gt;
&lt;P&gt;2) the Lesson number you are in&lt;/P&gt;
&lt;P&gt;3) whether you're working on an Activity or a Practice and the name of the Activity or Practice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Of these 3 pieces of information, you've only provided 1 piece and a snippet from the solution. If you're looking at the solution, then please look at the table for REG and TYPE at the TOP of that practice. We tell you exactly what values are VALID values. You need to then run the PROC FREQ step that we outline in #1 and &lt;U&gt;&lt;STRONG&gt;compare&lt;/STRONG&gt; &lt;/U&gt;what is in your actual data, with the valid values as stated at the top of the practice. This is the type of data validation that you have to do prior to any analysis or reporting with your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If you compare the PROC FREQ table for REG with the table at the top of the practice are there any invalid values? If you compare the PROC FREQ table for TYPE with the table at the top of the practice are there any invalid values? The solution tells you that there are NOT any invalid values for REG, but that there ARE invalid values for TYPE. Did you run the PROC FREQ step shown in the solution?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; When I ran the program in the solution, here's what I got:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Lesson3_practice.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/25794i952AEE496443F6C0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Lesson3_practice.png" alt="Lesson3_practice.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; As you can see, my PROC FREQ results show that the solution inside the class is correct and that in MY output, the invalid values for TYPE are NPRE, PRESERVE and RIVERWAYS. Again, you must manually compare the table from PROC FREQ to the stated valid values at the top of the practice. Later in the class, we will show you a way to write a program to determine valid and invalid values based on a list that you can provide in the code. But for now, we want to prove that sometimes your data is clean and sometimes it is not.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522410#M4432</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-12-19T02:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522412#M4433</link>
      <description>&lt;P&gt;Hi Cynthia,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have provided the further details for the clarification.But my question is not with the coding as I wrote the code right and got the result as mentioned in the solutions only.&lt;/P&gt;&lt;P&gt;However my question is that How we will find the invalid values. Like in the result we got three invalid values, So, my question is how are they invalid.&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aakarshan&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 02:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522412#M4433</guid>
      <dc:creator>Aakarshan</dc:creator>
      <dc:date>2018-12-19T02:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522421#M4435</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/247925"&gt;@Aakarshan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Cynthia,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have provided the further details for the clarification.But my question is not with the coding as I wrote the code right and got the result as mentioned in the solutions only.&lt;/P&gt;
&lt;P&gt;However my question is that How we will find the invalid values. Like in the result we got three invalid values, &lt;STRONG&gt;So, my question is how are they invalid.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Aakarshan&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;They're invalid because they're not in the list of valid codes provided and considered valid &lt;STRONG&gt;based on the criteria proposed in the question.&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Valid values and descriptions for the columns&amp;nbsp;Reg&amp;nbsp;and&amp;nbsp;Type&amp;nbsp;are as follows:...&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 04:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522421#M4435</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-19T04:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data [how to improve your question]</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522432#M4436</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; For every type of data you work with, there will always be rules. What values are OK in the data, what values are not OK in the data. In the class, we tell you what values are OK and not OK. In real life, other people tell you what's OK and not OK. Sometimes, the data itself tells you that something is not OK. For example, you have data with ages for patients. You have someone with an age value of 300 -- is that OK or not OK? The depends on the unit of measure for the age -- is it years or?? months or?? days??. 300 months of age would be OK. 300 years of age is highly unlikely.&lt;BR /&gt;&lt;BR /&gt;Same thing for salary. You are given data that has salaries. Somebody makes an annual salary of .05, in US currency, that means they are basically working for nearly nothing. Is that value OK or not OK? You would have to ask someone who knows the data whether that value is OK or not OK.&lt;BR /&gt;&lt;BR /&gt;In that practice we told you what values were OK. Your job was only to run PROC FREQ and determine for yourself whether the data was clean or not. As shown in the solution the REG values were all OK; the TYPE values were not.&lt;BR /&gt;&lt;BR /&gt;The table of valid values were meant to be like business rules that you encounter in a real job. Sometimes you know why valid values are valid; sometimes you don't. Your job is to learn how to run procedures to validate the data. Learning PROC FREQ is the first step.&lt;BR /&gt;&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 05:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522432#M4436</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-12-19T05:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data [how to improve your question]</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522494#M4446</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you Cynthia for your help and clearing my doubt.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aakarshan&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 12:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/522494#M4446</guid>
      <dc:creator>Aakarshan</dc:creator>
      <dc:date>2018-12-19T12:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/622304#M19753</link>
      <description>&lt;P&gt;The SAS output is as follows:&lt;/P&gt;&lt;P&gt;reg:&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;IM&lt;/P&gt;&lt;P&gt;MW&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;it is consistence with question page, but&amp;nbsp; type output is&amp;nbsp;&lt;/P&gt;&lt;P&gt;type:&lt;/P&gt;&lt;P&gt;NM&lt;/P&gt;&lt;P&gt;NP&lt;/P&gt;&lt;P&gt;NPRE&lt;/P&gt;&lt;P&gt;NS&lt;/P&gt;&lt;P&gt;PRE&lt;/P&gt;&lt;P&gt;PRESERVE&lt;/P&gt;&lt;P&gt;RIVERWAYS&lt;/P&gt;&lt;P&gt;RVR&lt;/P&gt;&lt;P&gt;but in the question page, the types are&amp;nbsp;&lt;/P&gt;&lt;P&gt;NM&lt;/P&gt;&lt;P&gt;NP&lt;/P&gt;&lt;P&gt;NS&lt;/P&gt;&lt;P&gt;RVR&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 21:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/622304#M19753</guid>
      <dc:creator>anranyu1996</dc:creator>
      <dc:date>2020-02-04T21:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Level 2 Practice: Using Procedures to Validate Data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/622323#M19754</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; In that practice, we provide you with the "rules" and show you what the valid REG and TYPE values are. They are listed for you at the top of the activity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Your task was to run PROC FREQ and determine for yourself whether the data was clean or not. This task required you to visually check what was in PROC FREQ against the table of valid values so you could decide whether you had "clean" data. As shown in the solution the REG values were all OK; the TYPE values were not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; The table of valid values were meant to be like business rules that you encounter in a real job. Sometimes you know why valid values are valid; sometimes you don't. Your job is to learn how to run procedures to validate the data. Learning PROC FREQ is the first step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; There are different ways to validate data. I am not going to post a program here that uses the class data. But consider this alternate scenario. I have a data table of students. All the students ages should be between 11-16 any ages outside that range are incorrect. Also, every student must have a signed permission slip. Here's what the fake student data looks like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="fake_data_students.png" style="width: 198px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35858i9CBF6B39F2169BD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="fake_data_students.png" alt="fake_data_students.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And, according to my stated rules, 3 rows in the data are not OK. Assuming I know what the valid values are, I can use PROC FORMAT to help me determine whether I have clean data or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I want to produce:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="use_format_validate.png" style="width: 549px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/35859iB650D1C283C79478/image-size/large?v=v2&amp;amp;px=999" role="button" title="use_format_validate.png" alt="use_format_validate.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note that my PROC FREQ output shows me the number of errors of each type. Then my PROC PRINT shows me the exact rows in error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Later in the course, you will learn about PROC FORMAT. Here's the full program that created the above data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data students;
  length name $10 signed_by $20;
  infile datalines dlm=',' dsd;
  input name $ signed_by $ age;
return;
datalines;
Anna,  "Grandmother", 17
Bob,   "Mother", 11
Carol, "Father", 13
Doug,  " ",15
Edith, "Step-mother",10
;
run;

proc print data=students;
title 'Student Data Before Validation';
run;

proc format;
  value ageck 11-16 = 'Age OK'
              other = 'Incorrect Age value';
			    
  value $signck 'Grandmother', 'Grandfather' = 'Permission OK'
               'Mother', 'Father' = 'Permission OK'
			   'Step-mother', 'Step-father' = 'Permission OK'
			   ' ', other = 'Error';
run;
  
proc freq data=students;
  table age signed_by / missing;
  format age ageck. signed_by $signck.;
  title 'Age Errors and Permission Errors';
run;
  
proc print data=students;
  where put(age,ageck.) = 'Incorrect Age value' or
        put(signed_by, $signck.) = 'Error';
  title 'Age Errors and Permission Errors';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Tue, 04 Feb 2020 22:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Level-2-Practice-Using-Procedures-to-Validate-Data/m-p/622323#M19754</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2020-02-04T22:47:06Z</dc:date>
    </item>
  </channel>
</rss>

