SAS Data Management

SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop, SAS Data Preparation and others
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
davis
Fluorite | Level 6

Good afternoon,

 

I am trying to modify the structure of a data set and unsure how.

 

Data Set I have:

 

Census_st_cde     01/01/1990     02/01/1990     03/01/1990     04/01/1990

         AL                      6.72                6.71               6.68                6.64

         AK                      7.17                7.21               7.22                7.21

 

Data Set I need:

 

                      Census_st_cde

01/01/1990             AL               6.72

01/01/1990             AK               7.17

02/01/1990             AL               6.71

02/01/1990             AK               7.21

03/01/1990             AL               6.68

03/01/1990             AK               7.22

04/01/1990             AL               6.64

04/01/1990             AK               7.21

 

Any thoughts would help.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

In the meantime, here's the code to do it.

 

Tom

 

proc sort data=Have;
	by Census_st_cde;
run;

proc transpose data=Have out=Want;
	by Census_st_cde;
run;

View solution in original post

2 REPLIES 2
TomKari
Onyx | Level 15

What form is your source dataset in? Those are illegal variable names for "stock" SAS variables. Are you using extended naming, or is it in a format like Excel or CSV?

 

Tom

TomKari
Onyx | Level 15

In the meantime, here's the code to do it.

 

Tom

 

proc sort data=Have;
	by Census_st_cde;
run;

proc transpose data=Have out=Want;
	by Census_st_cde;
run;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1148 views
  • 2 likes
  • 2 in conversation