<?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: Column Pointer Controls - @  cont... in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17876#M3450</link>
    <description>Hi:&lt;BR /&gt;
  An INPUT statement or column pointer of -23 or 1.35 doesn't make sense to me, just for the sake of using a negative number or a decimal number to see what will happen.&lt;BR /&gt;
&lt;BR /&gt;
  In the past, if I have ever needed to use a negative number for column pointer control (mostly this has happened when using a PUT statement -- not an INPUT statement), I have used a variable to hold the negative number and then used the variable in the PUT statement.&lt;BR /&gt;
&lt;BR /&gt;
  This usage worked for me in an INPUT statement, but again I think it's an artificial example. For this data, the NAME starts at column 1, the AGE starts at column 10 and the OTHER variable starts at column 14, as shown in the DATALINES section below:&lt;BR /&gt;
[pre]&lt;BR /&gt;
datalines;&lt;BR /&gt;
Alan     16  2&lt;BR /&gt;
Bob      17  3&lt;BR /&gt;
Carla    16  1&lt;BR /&gt;
Dana     15  3&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                      &lt;BR /&gt;
Then, you can see from the LOG that there are no errors for using variables with negative number:&lt;BR /&gt;
[pre]&lt;BR /&gt;
479  data tryread;&lt;BR /&gt;
480    length name $8;&lt;BR /&gt;
481    infile datalines;&lt;BR /&gt;
482    negcol = -23;&lt;BR /&gt;
483    colpnt = 10.35;&lt;BR /&gt;
484    input @negcol name $8. @colpnt age 2. @14 other 1.;&lt;BR /&gt;
485  return;&lt;BR /&gt;
486  datalines;&lt;BR /&gt;
           &lt;BR /&gt;
NOTE: The data set WORK.TRYREAD has 4 observations and 5 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
               &lt;BR /&gt;
491  ;&lt;BR /&gt;
492  run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
And, a PROC PRINT of the SAS data set shows that the input datalines were read correctly:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  Obs    name     negcol    colpnt    age    other&lt;BR /&gt;
   1     Alan       -23      10.35     16      2&lt;BR /&gt;
   2     Bob        -23      10.35     17      3&lt;BR /&gt;
   3     Carla      -23      10.35     16      1&lt;BR /&gt;
   4     Dana       -23      10.35     15      3&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
But, as I said, I'm not sure about WHY you would want to do this. You quoted the documentation about @n -- Did you look at the example provided for that particular documentation section?? &lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
Featured in: Moving the Pointer Backward &lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
 and if you go to Example 7 on Moving the Pointer Backward, you will see the following example of using a negative number:&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;&lt;BR /&gt;
Example 7: Moving the Pointer Backward &lt;/U&gt;&lt;BR /&gt;
                  &lt;BR /&gt;
This example shows several ways to move the pointer backward. &lt;BR /&gt;
                                 &lt;BR /&gt;
•  This INPUT statement uses the @ pointer control to read a value for BOOK starting at column 26. Then the pointer moves back to column 1 on the same line to read a value for COMPANY: &lt;BR /&gt;
              &lt;BR /&gt;
input @26 book $ @1 company;&lt;BR /&gt;
                   &lt;BR /&gt;
•   These INPUT statements use +numeric-variable or +(expression) to move the pointer backward one column. These two sets of statements are equivalent.&lt;BR /&gt;
                                    &lt;BR /&gt;
•   m=-1;&lt;BR /&gt;
    input x 1-10 +m y 2.;&lt;BR /&gt;
                &lt;BR /&gt;
•   input x 1-10 +(-1) y 2.;&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
  It seems to me that the example of using a negative number in parentheses or using a variable name (also shown in the doc) are pretty straightforward.&lt;BR /&gt;
 &lt;BR /&gt;
  I guess for me, the bottom line is -- what does your data actually look like??? Do you really need to provide a negative number or a decimal number for an INPUT pointer control??? For what purpose?? Where you are reading data, there is no decimal location -- there are only whole columns. If you have binary or packed data, there are other ways to read the input file that are more accurate methods than using a negative number or a decimal number.&lt;BR /&gt;
 &lt;BR /&gt;
  For future reference, it is possible to post material with &amp;lt; or &amp;gt; symbols. All you have to do is "mask" them so they are not interpreted as HTML tags by the forum posting mechanism, as described in this previous forum posting:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt; &lt;BR /&gt;
..which talks about characters like &amp;lt; or &amp;gt; and how to alter your posting so that these characters do not interfere with the posted information.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
    <pubDate>Sat, 16 Oct 2010 03:40:02 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-10-16T03:40:02Z</dc:date>
    <item>
      <title>Column Pointer Controls - @  cont...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17875#M3449</link>
      <description>Cont... from previous post - &lt;BR /&gt;
The  symbol combination for less than or equal to  was not allowed here in the post. The post got ended there. Hence using the words - &lt;BR /&gt;
&lt;BR /&gt;
1 (less than or equal to) N (less than or equal to) 2147483647.&lt;BR /&gt;
301  run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
WARNING: The data set SAS_EX.GC_PEOPLE may be incomplete.  When this step was stopped there were 0&lt;BR /&gt;
         observations and 1 variables.&lt;BR /&gt;
WARNING: Data set SAS_EX.GC_PEOPLE was not replaced because this step was stopped.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.05 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Observation 03:&lt;BR /&gt;
input @1.35 Name $; &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Log:&lt;BR /&gt;
307  input @1.35 Name $;&lt;BR /&gt;
            ----&lt;BR /&gt;
            22&lt;BR /&gt;
            500&lt;BR /&gt;
ERROR 22-322: Expecting a name.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 500-185: Decimal specified for informat F is invalid.&lt;BR /&gt;
&lt;BR /&gt;
308  run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
WARNING: The data set SAS_EX.GC_PEOPLE may be incomplete.  When this step was stopped there were 0&lt;BR /&gt;
         observations and 0 variables.&lt;BR /&gt;
WARNING: Data set SAS_EX.GC_PEOPLE was not replaced because this step was stopped.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.05 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
It would be great if someone could let me know whether the documentation is incorrect?</description>
      <pubDate>Sat, 16 Oct 2010 00:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17875#M3449</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-16T00:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Column Pointer Controls - @  cont...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17876#M3450</link>
      <description>Hi:&lt;BR /&gt;
  An INPUT statement or column pointer of -23 or 1.35 doesn't make sense to me, just for the sake of using a negative number or a decimal number to see what will happen.&lt;BR /&gt;
&lt;BR /&gt;
  In the past, if I have ever needed to use a negative number for column pointer control (mostly this has happened when using a PUT statement -- not an INPUT statement), I have used a variable to hold the negative number and then used the variable in the PUT statement.&lt;BR /&gt;
&lt;BR /&gt;
  This usage worked for me in an INPUT statement, but again I think it's an artificial example. For this data, the NAME starts at column 1, the AGE starts at column 10 and the OTHER variable starts at column 14, as shown in the DATALINES section below:&lt;BR /&gt;
[pre]&lt;BR /&gt;
datalines;&lt;BR /&gt;
Alan     16  2&lt;BR /&gt;
Bob      17  3&lt;BR /&gt;
Carla    16  1&lt;BR /&gt;
Dana     15  3&lt;BR /&gt;
;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                                      &lt;BR /&gt;
Then, you can see from the LOG that there are no errors for using variables with negative number:&lt;BR /&gt;
[pre]&lt;BR /&gt;
479  data tryread;&lt;BR /&gt;
480    length name $8;&lt;BR /&gt;
481    infile datalines;&lt;BR /&gt;
482    negcol = -23;&lt;BR /&gt;
483    colpnt = 10.35;&lt;BR /&gt;
484    input @negcol name $8. @colpnt age 2. @14 other 1.;&lt;BR /&gt;
485  return;&lt;BR /&gt;
486  datalines;&lt;BR /&gt;
           &lt;BR /&gt;
NOTE: The data set WORK.TRYREAD has 4 observations and 5 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
               &lt;BR /&gt;
491  ;&lt;BR /&gt;
492  run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
  &lt;BR /&gt;
And, a PROC PRINT of the SAS data set shows that the input datalines were read correctly:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  Obs    name     negcol    colpnt    age    other&lt;BR /&gt;
   1     Alan       -23      10.35     16      2&lt;BR /&gt;
   2     Bob        -23      10.35     17      3&lt;BR /&gt;
   3     Carla      -23      10.35     16      1&lt;BR /&gt;
   4     Dana       -23      10.35     15      3&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
But, as I said, I'm not sure about WHY you would want to do this. You quoted the documentation about @n -- Did you look at the example provided for that particular documentation section?? &lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
Featured in: Moving the Pointer Backward &lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
 and if you go to Example 7 on Moving the Pointer Backward, you will see the following example of using a negative number:&lt;BR /&gt;
&lt;B&gt;&lt;U&gt;&lt;BR /&gt;
Example 7: Moving the Pointer Backward &lt;/U&gt;&lt;BR /&gt;
                  &lt;BR /&gt;
This example shows several ways to move the pointer backward. &lt;BR /&gt;
                                 &lt;BR /&gt;
•  This INPUT statement uses the @ pointer control to read a value for BOOK starting at column 26. Then the pointer moves back to column 1 on the same line to read a value for COMPANY: &lt;BR /&gt;
              &lt;BR /&gt;
input @26 book $ @1 company;&lt;BR /&gt;
                   &lt;BR /&gt;
•   These INPUT statements use +numeric-variable or +(expression) to move the pointer backward one column. These two sets of statements are equivalent.&lt;BR /&gt;
                                    &lt;BR /&gt;
•   m=-1;&lt;BR /&gt;
    input x 1-10 +m y 2.;&lt;BR /&gt;
                &lt;BR /&gt;
•   input x 1-10 +(-1) y 2.;&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
  It seems to me that the example of using a negative number in parentheses or using a variable name (also shown in the doc) are pretty straightforward.&lt;BR /&gt;
 &lt;BR /&gt;
  I guess for me, the bottom line is -- what does your data actually look like??? Do you really need to provide a negative number or a decimal number for an INPUT pointer control??? For what purpose?? Where you are reading data, there is no decimal location -- there are only whole columns. If you have binary or packed data, there are other ways to read the input file that are more accurate methods than using a negative number or a decimal number.&lt;BR /&gt;
 &lt;BR /&gt;
  For future reference, it is possible to post material with &amp;lt; or &amp;gt; symbols. All you have to do is "mask" them so they are not interpreted as HTML tags by the forum posting mechanism, as described in this previous forum posting:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt; &lt;BR /&gt;
..which talks about characters like &amp;lt; or &amp;gt; and how to alter your posting so that these characters do not interfere with the posted information.&lt;BR /&gt;
&lt;BR /&gt;
cynthia</description>
      <pubDate>Sat, 16 Oct 2010 03:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17876#M3450</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-16T03:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Column Pointer Controls - @  cont...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17877#M3451</link>
      <description>Thanks a lot Cynthia for the Crystal clear explanation... &lt;BR /&gt;
&lt;BR /&gt;
I am one week old into SAS and was trying to explore scenarios for what I read in the documentation. In the real world, this might not be a possibility. &lt;BR /&gt;
&lt;BR /&gt;
Thanks so much and would come up with a better doubt next time.</description>
      <pubDate>Sat, 16 Oct 2010 06:56:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17877#M3451</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-16T06:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Column Pointer Controls - @  cont...</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17878#M3452</link>
      <description>Hi:&lt;BR /&gt;
  Since most of my explanation came -directly and unedited- from the documentation, my recommendation would be that you read or try the posted examples in the documentation as a means of understanding how various syntax alternatives work.&lt;BR /&gt;
 &lt;BR /&gt;
  Also, having "real" scenarios or "real" data might be a better learning technique to find more common usage examples -- instead of focussing on some of the least common (but possible) usages. One way to find real scenarios aside from the documentation examples is to search for user group papers on your topic of interest. For example, a Google search on the string:&lt;BR /&gt;
SAS DATA step INPUT statement&lt;BR /&gt;
 &lt;BR /&gt;
...yields as the first 2 hits some user group papers and a SAS paper that is a walkthrough of the DATA step and how it reads data. Even a simple search string:&lt;BR /&gt;
SAS reading data&lt;BR /&gt;
&lt;BR /&gt;
...nets quite a list of resources on the topic of using SAS to read data.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Sun, 17 Oct 2010 17:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Column-Pointer-Controls-cont/m-p/17878#M3452</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-17T17:14:56Z</dc:date>
    </item>
  </channel>
</rss>

