<?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 verify the format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834130#M329793</link>
    <description>&lt;P&gt;in my data I am verify format like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ds;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input &amp;nbsp;Protcol_ID/NO$ 14.&amp;nbsp;Site ID&amp;nbsp;Subject Id;&lt;/P&gt;&lt;P&gt;datalines ;&lt;/P&gt;&lt;P&gt;ONC_AP/01234-1&amp;nbsp;102. &amp;nbsp; &amp;nbsp; &amp;nbsp;aaa&lt;/P&gt;&lt;P&gt;ONC_AP/01234-7 &amp;nbsp;103. &amp;nbsp; &amp;nbsp; abc&lt;/P&gt;&lt;P&gt;ON1_AP/01234-2. &amp;nbsp;105. &amp;nbsp; &amp;nbsp; bbc&lt;/P&gt;&lt;P&gt;O1C_AP/01234-2. &amp;nbsp; 108. &amp;nbsp; &amp;nbsp;ccd&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;in my data cam verify&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 .length above 15 char&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.protocal id must&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;be 15 charcter&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;charcter&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3.first starting&amp;nbsp; 3 letters must be charcter only&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4.first 3 letters a numerical values its an error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5.first 3 letters a&amp;nbsp;combination&amp;nbsp;alphabets&amp;nbsp;and numeric values it's an error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;how&amp;nbsp;too verify right&amp;nbsp;&lt;/SPAN&gt;protocol format , how test length position values specification ,&lt;/P&gt;&lt;P&gt;any can please help how test the protocol using if conditions&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;first 3 letters no special charcter and spaces its an error&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Sep 2022 17:11:20 GMT</pubDate>
    <dc:creator>venunaidu</dc:creator>
    <dc:date>2022-09-19T17:11:20Z</dc:date>
    <item>
      <title>verify the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834130#M329793</link>
      <description>&lt;P&gt;in my data I am verify format like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data ds;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input &amp;nbsp;Protcol_ID/NO$ 14.&amp;nbsp;Site ID&amp;nbsp;Subject Id;&lt;/P&gt;&lt;P&gt;datalines ;&lt;/P&gt;&lt;P&gt;ONC_AP/01234-1&amp;nbsp;102. &amp;nbsp; &amp;nbsp; &amp;nbsp;aaa&lt;/P&gt;&lt;P&gt;ONC_AP/01234-7 &amp;nbsp;103. &amp;nbsp; &amp;nbsp; abc&lt;/P&gt;&lt;P&gt;ON1_AP/01234-2. &amp;nbsp;105. &amp;nbsp; &amp;nbsp; bbc&lt;/P&gt;&lt;P&gt;O1C_AP/01234-2. &amp;nbsp; 108. &amp;nbsp; &amp;nbsp;ccd&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;in my data cam verify&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 .length above 15 char&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.protocal id must&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;be 15 charcter&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;charcter&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3.first starting&amp;nbsp; 3 letters must be charcter only&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4.first 3 letters a numerical values its an error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5.first 3 letters a&amp;nbsp;combination&amp;nbsp;alphabets&amp;nbsp;and numeric values it's an error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;how&amp;nbsp;too verify right&amp;nbsp;&lt;/SPAN&gt;protocol format , how test length position values specification ,&lt;/P&gt;&lt;P&gt;any can please help how test the protocol using if conditions&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;first 3 letters no special charcter and spaces its an error&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:11:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834130#M329793</guid>
      <dc:creator>venunaidu</dc:creator>
      <dc:date>2022-09-19T17:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: verify the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834140#M329801</link>
      <description>&lt;P&gt;Maybe I'm not understanding your request ... however ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Length of what?&lt;/LI&gt;
&lt;LI&gt;since the variable is read in as $14. it is never 15 characters&lt;/LI&gt;
&lt;LI&gt;and 4. and 5. use the NOTALPHA function like this:&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if notalpha(protocol_id)&amp;lt;=3 then error=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:49:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834140#M329801</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-19T17:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: verify the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834164#M329810</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/433949"&gt;@venunaidu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;in my data I am verify format like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data ds;&lt;/P&gt;
&lt;P&gt;infile datalines;&lt;/P&gt;
&lt;P&gt;input &amp;nbsp;Protcol_ID/NO$ 14.&amp;nbsp;Site ID&amp;nbsp;Subject Id;&lt;/P&gt;
&lt;P&gt;datalines ;&lt;/P&gt;
&lt;P&gt;ONC_AP/01234-1&amp;nbsp;102. &amp;nbsp; &amp;nbsp; &amp;nbsp;aaa&lt;/P&gt;
&lt;P&gt;ONC_AP/01234-7 &amp;nbsp;103. &amp;nbsp; &amp;nbsp; abc&lt;/P&gt;
&lt;P&gt;ON1_AP/01234-2. &amp;nbsp;105. &amp;nbsp; &amp;nbsp; bbc&lt;/P&gt;
&lt;P&gt;O1C_AP/01234-2. &amp;nbsp; 108. &amp;nbsp; &amp;nbsp;ccd&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;in my data cam verify&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 .length above 15 char&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.protocal id must&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;be 15 charcter&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;charcter&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3.first starting&amp;nbsp; 3 letters must be charcter only&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;4.first 3 letters a numerical values its an error&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;5.first 3 letters a&amp;nbsp;combination&amp;nbsp;alphabets&amp;nbsp;and numeric values it's an error&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;how&amp;nbsp;too verify right&amp;nbsp;&lt;/SPAN&gt;protocol format , how test length position values specification ,&lt;/P&gt;
&lt;P&gt;any can please help how test the protocol using if conditions&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;first 3 letters no special charcter and spaces its an error&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;First thing, your data step throws errors because of the variable name Protcol_ID/NO is not valid.&lt;/P&gt;
&lt;P&gt;Second, your requirement 2 can never be true with that data step as you have forced it to be 14 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is "1 .length above 15 char " supposed to be something like " length greater than 15 characters is an error"? If so, what do you want to happen when it occurs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you want to see for output when one of the rules is not met or is an error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;If length protocol_id  ne 15 then &amp;lt;do what you want when the length is incorrect&amp;gt;;
&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Sep 2022 19:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834164#M329810</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-09-19T19:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: verify the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834201#M329818</link>
      <description>Read only correct format of protocol_id .&lt;BR /&gt;&lt;BR /&gt;eg: cds_ap/01234-3 this the correct format of protocol&lt;BR /&gt;a1s_ap/01234-3 this the wrong format of protocol&lt;BR /&gt;123_ap/01234-3 this the wrong format protocol&lt;BR /&gt;&lt;BR /&gt;length is same in every observation , but format is incorrect , protocol&lt;BR /&gt;format is wrong kept into another dataset . how verify the format wrong or&lt;BR /&gt;correct .&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Sep 2022 01:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834201#M329818</guid>
      <dc:creator>venunaidu</dc:creator>
      <dc:date>2022-09-20T01:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: verify the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834243#M329843</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/433949"&gt;@venunaidu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;cds_ap/01234-3 this the correct format of protocol&lt;BR /&gt;a1s_ap/01234-3 this the wrong format of protocol&lt;BR /&gt;123_ap/01234-3 this the wrong format protocol&lt;BR /&gt;&lt;BR /&gt;length is same in every observation , but format is incorrect , protocol&lt;BR /&gt;format is wrong kept into another dataset . how verify the format wrong or&lt;BR /&gt;correct .&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please explain further ... which format is incorrect and why is it incorrect and what would be correct????? Did you try using the NOTALPHA function as I suggested?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 10:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834243#M329843</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-20T10:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: verify the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834247#M329846</link>
      <description>&lt;P&gt;&amp;nbsp;I want find the correct protocol format my protocol format is first letters 3 alphabets,4th position is underscore, 5th to 6th position is alphabets,7th position backward slash , after 7th to 12th position value values after 13th position '-' , 14th to 15th position value. eg (apc_ec/01234-43), how to verify each value in protocol variable , anyone can please me .&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 10:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834247#M329846</guid>
      <dc:creator>venunaidu</dc:creator>
      <dc:date>2022-09-20T10:25:38Z</dc:date>
    </item>
    <item>
      <title />
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834251#M329849</link>
      <description />
      <pubDate>Tue, 20 Sep 2022 11:15:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834251#M329849</guid>
      <dc:creator>venunaidu</dc:creator>
      <dc:date>2022-09-20T11:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: verify protocol values each values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834255#M329850</link>
      <description>&lt;P&gt;Please don't double post questions.&lt;/P&gt;
&lt;P&gt;Your data step still has errors. Please verify your code.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 11:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834255#M329850</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-09-20T11:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: verify the format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834268#M329855</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/433949"&gt;@venunaidu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;I want find the correct protocol format my protocol format is first letters 3 alphabets,&lt;FONT color="#FF0000"&gt;4th position is underscore, 5th to 6th position is alphabets,7th position backward slash , after 7th to 12th position value values after 13th position '-' , 14th to 15th position value. eg (apc_ec/01234-43), how to verify each value in protocol variable &lt;FONT color="#000000"&gt;, anyone can please me .&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The part in red is new information that was not stated previously. In the future, you will get faster and better answers if you provide a complete explanation in your first post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
     set have;
    if notalpha(protocol_id)&amp;lt;=3 or substr(protocol_id,4,1)^='_' or
        0&amp;lt;notalpha(protocol_id,5)&amp;lt;=6 or substr(protocol_id,7,1)^='/'
        or substr(protocol_id,13,1)^='-' or 0&amp;lt;notdigit(protocol_id,8)&amp;lt;=12
        or 0&amp;lt;notdigit(protocol_id,14)&amp;lt;=15 then error=1;
    else error=0;    
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please fix your original code to spell variable names correctly, to read the protocol_id so it is 15 characters, and your description talks about backslash but the code above uses a forward slash, which is what your data contains.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 12:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/verify-the-format/m-p/834268#M329855</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-20T12:02:46Z</dc:date>
    </item>
  </channel>
</rss>

