BookmarkSubscribeRSS Feed
anming
Pyrite | Level 9
data list_modified;
input name $ & +3 lastname & $16. team $;
datalines;
Joseph Joergensen White Red
Mitchel Mc Allister blue
Su Ellen Fischer Simon green
;
run;

what does '+3' mean? without '+' only letter at position 3 is loaded for the name.  

5 REPLIES 5
mkeintz
PROC Star

Change the +3 to, say, +6, and look at the result for lastname.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
anming
Pyrite | Level 9
it works from without, +0 to +3. but from +4 the last name will be truncated.
mkeintz
PROC Star

@anming wrote:
it works from without, +0 to +3. but from +4 the last name will be truncated.

Truncated on which side?

What does that tell you about the function of prefixing a number with a "+"?

 

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
anming
Pyrite | Level 9

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=lestmtsref&docsetTarget=n...

 

'@n' is the column point controls. '+m' means to shift m positions to the right. 

Tom
Super User Tom
Super User

Without the + the 3 means you want to read the variable NAME using COLUMN input instead of LIST MODE (modified or not).

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 922 views
  • 1 like
  • 3 in conversation