Help using Base SAS procedures

Column Pointer Controls - @

Reply
N/A
Posts: 0

Column Pointer Controls - @

From sas documentation:
@n
moves the pointer to column n.

Range: a positive integer
Tip: If n is not an integer, SAS truncates the decimal value and uses only the integer value. If n is zero or negative, the pointer moves to column 1.
Example: @15 moves the pointer to column 15:
input @15 name $10.;

Observation 01:
input @-23 Name $ ;
run;

Log:
293 input @-23 Name $ ;
-
22
--
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string,
an integer constant, arrayname, #, (, +, /, //, ;, @, @@.

ERROR 200-322: The symbol is not recognized and will be ignored.

294 run;

Observation 02:
input @0 Name $ ;

ERROR: The specified value for the '@' INPUT/PUT statement option must be within the range 1<=N<=
2147483647.

Observation 03:
input @1.35 Name $;
Log:
ERROR 500-185: Decimal specified for informat F is invalid.

Is the documentation incorrect? Can anybody please explain this?
Valued Guide
Posts: 2,177

Re: Column Pointer Controls - @

Posted in reply to deleted_user
instead of -23 being considered a value, the "-" is considered separately, hence confusion!
To treat -23 as a value in that context, use (-23), or @(-23)
Seems almost pointless, but input @( position-23) might be useful
Ask a Question
Discussion stats
  • 1 reply
  • 174 views
  • 0 likes
  • 2 in conversation