Hi:
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.
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.
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:
[pre]
datalines;
Alan 16 2
Bob 17 3
Carla 16 1
Dana 15 3
;
[/pre]
Then, you can see from the LOG that there are no errors for using variables with negative number:
[pre]
479 data tryread;
480 length name $8;
481 infile datalines;
482 negcol = -23;
483 colpnt = 10.35;
484 input @negcol name $8. @colpnt age 2. @14 other 1.;
485 return;
486 datalines;
NOTE: The data set WORK.TRYREAD has 4 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
491 ;
492 run;
[/pre]
And, a PROC PRINT of the SAS data set shows that the input datalines were read correctly:
[pre]
Obs name negcol colpnt age other
1 Alan -23 10.35 16 2
2 Bob -23 10.35 17 3
3 Carla -23 10.35 16 1
4 Dana -23 10.35 15 3
[/pre]
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??
Featured in: Moving the Pointer Backward
and if you go to Example 7 on Moving the Pointer Backward, you will see the following example of using a negative number:
Example 7: Moving the Pointer Backward
This example shows several ways to move the pointer backward.
• 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:
input @26 book $ @1 company;
• These INPUT statements use +numeric-variable or +(expression) to move the pointer backward one column. These two sets of statements are equivalent.
• m=-1;
input x 1-10 +m y 2.;
• input x 1-10 +(-1) y 2.;
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.
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.
For future reference, it is possible to post material with < or > 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:
http://support.sas.com/forums/thread.jspa?messageID=27609毙
..which talks about characters like < or > and how to alter your posting so that these characters do not interfere with the posted information.
cynthia