DATA Step, Macro, Functions and more

Pointer control

Posts: 24

Pointer control states the following:

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.

But when I tried the following code a syntax error appears:
data test;
infile tests obs=5;
input ID $ Name & $14. @-27 (a1-a5) (3.) Level $;
input ID $ Name & $14. @-27 (a1-a5) (3.) Level $;

When I replaced -27 with 27.78 then also the syntax error appeared. Finally when I replaced 27.78 with 27 the program worked fine. Can someone explain that why is the Tip on not working? I'm using SAS 9.2.
Trusted Advisor
Posts: 2,118

Re: Pointer control

Again, which tip.

If is an expression, the operation works as described. I does fail as you described when you provide a literal.

The problem is that the compiler can't differentiate between, for instance, a subtraction and an infix operator because the context is not clear.

There is a pretty full discussion at

Doc Muhlbaier
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation