SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
zfusfeld
Fluorite | Level 6

I think the question is pretty self explanatory.

I have a dataset that I need to convert to a specially structured dataset for an analytic procedure I am doing (proc mianalyze). It is currently of an unspecified type, and I need to convert it to an EST type structure. 

I thought it would be a simple datastep, e.g.

 

data cov1 type=EST;
set cov1;
run;

but this spits out a syntax error. 

 

Can someone link to a resource on how to manipulate the dataset to be of the EST data structure? 

1 ACCEPTED SOLUTION

Accepted Solutions
mkeintz
PROC Star

A minor efficiency note.  You don't have to copy a data set to change its type to EST.  Instead you can modify the metadata for COV1 using PROC DATASETS.

 

 


proc datasets lib=work nodetails nolist;
  modify cov1 (type=EST);
quit;

:

 

 

--------------------------
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

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

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

You did not include the ( ) needed when you have dataset options.

Try:

data cov1 (type=EST);
  set cov1;
run;

 

mkeintz
PROC Star

A minor efficiency note.  You don't have to copy a data set to change its type to EST.  Instead you can modify the metadata for COV1 using PROC DATASETS.

 

 


proc datasets lib=work nodetails nolist;
  modify cov1 (type=EST);
quit;

:

 

 

--------------------------
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

--------------------------
zfusfeld
Fluorite | Level 6

thanks! I also realized i could call the type in the mi analyze procedure a la 

 

proc mianalyze data=cov1(type=EST);
modeleffects intercept x1 x2 x3;
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 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 726 views
  • 4 likes
  • 3 in conversation