BookmarkSubscribeRSS Feed
anushagandla
Calcite | Level 5

data temp;

input  skill_set : $50.  @ ;

--------------

---------------

run;

 

 

hi,  

what do we mean by the above input statement, what is the meaning of ':' and '@' in the above statement.

1 REPLY 1
ballardw
Super User

The : is used to indicate that the format reading the data starts reading at the next non-blank column until it reaches a blank column in the data. If the : then a format may force reading more characters than you intend when the length of values vary. Note the value of x in the first data set and the error message in the first example step below. Then the behavior with the :

 

data example;
   input x $10. y;
datalines;
short 23
longer    19
;
run;

data example2;
   input x : $10. y;
datalines;
short 23
longer    19
;
run;

 

 

The @ holds the input pointer on the same line. One use is conditionally read data depending on the values of something read before the @ sign.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1155 views
  • 0 likes
  • 2 in conversation