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

I gave a link to an example using PROC GLMMOD which produces the desired output data set.

--
Paige Miller
joon1
Quartz | Level 8

Thanks for your kind reply. However, proc glmmod procedure stops the SAS program several times. Is there any easy way to convert the character variable below to dummy variables in the current sas dataset? Thanks.

 

dummy_sic2 Frequency Percent CumulativeFrequency CumulativePercentind#01ind#02ind#07ind#08
160.11160.11
20.01180.13
10.01190.14
20.01210.15
PaigeMiller
Diamond | Level 26

The easiest way is PROC GLM MOD. Show us the ENTIRE log for the PROC GLM MOD step.

--
Paige Miller
joon1
Quartz | Level 8

When I run the following program, the whole SAS program stops without saving.
ods output out=m21;
proc glmmod data=m20;
model ln_audit = sdd1 sstmat leverage sodebt cspec ln_nonaudit icw restatement gc auchange merger financing yearend
ln_at mb big4 roa loss fsalepro sq_segs ar_in special_item ln_tenure y2000-y2016 dummy_sic2; run;

 

Thanks

Joon1

PaigeMiller
Diamond | Level 26

I don't see this command (copied exactly from the example)

 

ods output DesignPoints = DesignMatrix;

Also, from now on, we request that when you need to show us the code you are using, please click on the "little running man" icon and paste your code into the window that appears.

--
Paige Miller
joon1
Quartz | Level 8

Thanks, PaigeMiller.

 

When I run the following program, the whole SAS program still stops without running and saving.
ods output DesignPoints = DesignMatrix;
proc glmmod data=m20;

class dummy_sic2;
model ln_audit = sdd1 sstmat leverage sodebt cspec ln_nonaudit icw restatement gc auchange merger financing yearend
ln_at mb big4 roa loss fsalepro sq_segs ar_in special_item ln_tenure y2000-y2016 dummy_sic2; run;

 

Thanks

joon1

 

Thanks

Joon1

PaigeMiller
Diamond | Level 26

@joon1 wrote:

Thanks, PaigeMiller.

 

When I run the following program, the whole SAS program still stops without running and saving.


I don't know what this means. Explain further. Provide details.

 

I asked you to show us the log earlier, and this didn't happen. So I ask again. Show us the LOG from when you run the code. This includes the entire LOG for PROC GLMMOD, in other words the code for PROC GLMMOD as seen in the LOG, plus all NOTEs, WARNINGs and ERRORs with PROC GLMMOD, with nothing chopped out, everything. Paste the log into the window that appears when you click on the </> icon. DO NOT SKIP THIS STEP.

 

 

--
Paige Miller
joon1
Quartz | Level 8

I see the message above "SAS (Not Responding)" in the sas window. The code I presented is not working for whatever reason.

 

PaigeMiller
Diamond | Level 26

Unless your data set has hundreds of millions of records, I can't think of a reason why this code would cause SAS would go into not responding mode. How many records are in the data set?

 

Did you try re-starting SAS? 

--
Paige Miller
joon1
Quartz | Level 8

The number of observations are 30,000-40,000. I tried several times, but I face similar situations.

Is there any way to create industry dummy variables instead of "ind#" variables below?

length dummy_sic2 $ 10;
dummy_sic2=cats('ind#',put(sic2,z2.));

 

Thanks

Joon1

 

PaigeMiller
Diamond | Level 26

Well, I am stumped, and there's something wrong here. This code (using a smaller data set) runs almost instantly, doesn't cause a freeze. Even with your data set of 40,000 records, similar code ought to run quickly (although not instantly) and I can't understand why your SAS freezes.

 

ods output DesignPoints = DesignMatrix;
proc glmmod data=sashelp.cars;
    class make;
	model msrp = make invoice enginesize cylinders horsepower mpg_city mpg_highway weight wheelbase length;
run;

Why do you need the ind# in your dummy_sic2 values, anyway? Although that shouldn't make a difference, what happens if you use 

dummy_sic2=put(sic2,z2.);

Anyway, here is another way to generate dummy variables: https://blogs.sas.com/content/iml/2020/08/31/best-generate-dummy-variables-sas.html

 

--
Paige Miller
joon1
Quartz | Level 8

Thank you for your kind response. My SAS window freezes with glmmod procedure. Thank you for your valuable time. Have a good day and stay safe.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 26 replies
  • 3264 views
  • 0 likes
  • 4 in conversation