BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AbuChowdhury
Fluorite | Level 6

By the by, how can I change the data structure of "p2004_usa" to long-structured through proc sql and vice versa?

Reeza
Super User

Use Proc Transpose or a Data step.

Generally, PROC SQL isn't a good way to transpose data.

http://www.ats.ucla.edu/stat/sas/modules/wtol_transpose.htm

Ksharp
Super User

How do you map these ar1 ,ar2 .......  into US0010311035 US00163U1060 ..  ? they have the exactly same order ?

AbuChowdhury
Fluorite | Level 6

I got ar1, ar2 from another calculations. Yes, they are in same order: ar1, ar2, ar3,........

Ksharp
Super User

Add this

options dkricond=nowarn  dkrocond=nowarn ;

before data step.

AbuChowdhury
Fluorite | Level 6

Same as before. Now the output dataset has only 'Date' variable. Other variables are gone.

PGStats
Opal | Level 21

Listen to 's sound advice. - PG

PG
Reeza
Super User

To limit your data you can use a WHERE statement in a data step or proc, assuming you have a SAS date.

e.g.

where year(date)=2004;

How to use the data set decile? That depends on how you want to use it. I suspect you'll need to merge it in but you'll have to provide a sample input/output for more detailed help.

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!

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
  • 22 replies
  • 1521 views
  • 11 likes
  • 5 in conversation