BookmarkSubscribeRSS Feed
jerry898969
Pyrite | Level 9
Let me start off by saying that I'm very new to SAS so excuse me for any minor mistakes.

I'm trying to create a dataset that will have an ID column with autogenerated numbers as the ID's.
With this dataset how can I had an Id field as the first column?

data Person;
input fname $ lname $ city $;
datalines;
BOB JONES BOSTON
FRED SMITH MIAMI
;
run;

Thank You
Jerry
3 REPLIES 3
Peter_C
Rhodochrosite | Level 12
add a line just before the input statement[pre] ID+1 ;[/pre]
good Luck

PeterC
jerry898969
Pyrite | Level 9
Pete,
Thank you so much that was simple enough.

In my data lines what do I have to do to get New York as the city, it only shows New?

Thanks again
Jerry
jerry898969
Pyrite | Level 9
Nevermind I figured it out $20. fixed it in the input statement.

Thanks again for the help
Jerry

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 2679 views
  • 0 likes
  • 2 in conversation