Help using Base SAS procedures

Help for a new SAS user- ERROR: Asterisks are an indication of a format width problem

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

Help for a new SAS user- ERROR: Asterisks are an indication of a format width problem

Hi, I am a student and learning how to use SAS by replicating the result from a published paper. I faced a long list of "ERROR: Asterisks are an indication of a format width problem". As you can see from the screenshot, there are some that are calculated corrected, but most of the variables are indicated with asterisks. What I am trying to do is to do a sum up for each variable (28 in total) by year. I am not sure whether it is due to some of the variables have format as numeric 1. while some are in numeric best12. But this is not the case when I check those that managed to sum up, they are a mixture of both numeric formats.

The following is my codes with the variables in red.

proc sort data=sas.governancedropt1;

    by year;

run;

proc means data=sas.governancedropt1 noprint;

    var BLANKCHECK CBOARD LSPMT LWCNST COMPPLAN DIRIND DIRLIAB GOLDENPARACHUTE SEVERANCE CUMVOTE

    CUMVOTESS LABYLW LACHTR SECRETBALLOT SUPERMAJOR UNEQVOTE ANTIGREEN DUTIESNF FAIRPRICE PPARACHUTE

    PPILL SPARACHUTE SL_BUSCOMP SL_CASHOUT SL_CSA SL_DUTIES SL_FAIRPRICE SL_RPROFITS;

    output out=governancedropt1_byyear (drop=_type_ _freq_)

        sum(BLANKCHECK CBOARD LSPMT LWCNST COMPPLAN DIRIND DIRLIAB GOLDENPARACHUTE SEVERANCE CUMVOTE

    CUMVOTESS LABYLW LACHTR SECRETBALLOT SUPERMAJOR UNEQVOTE ANTIGREEN DUTIESNF FAIRPRICE PPARACHUTE

    PPILL SPARACHUTE SL_BUSCOMP SL_CASHOUT SL_CSA SL_DUTIES SL_FAIRPRICE SL_RPROFITS)

        = BLANKCHECK1 CBOARD1 LSPMT1 LWCNST1 COMPPLAN1 DIRIND1 DIRLIAB1 GOLDENPARACHUTE1 SEVERANCE1 CUMVOTE1

    CUMVOTESS1 LABYLW1 LACHTR1 SECRETBALLOT1 SUPERMAJOR1 UNEQVOTE1 ANTIGREEN1 DUTIESNF1 FAIRPRICE1 PPARACHUTE1

    PPILL1 SPARACHUTE1 SL_BUSCOMP1 SL_CASHOUT1 SL_CSA1 SL_DUTIES1 SL_FAIRPRICE1 SL_RPROFITS1;

    by year;

run;


Accepted Solutions
Solution
‎04-02-2015 01:01 PM
Regular Contributor
Posts: 217

Re: Help for a new SAS user- ERROR: Asterisks are an indication of a format width problem

Perhaps this will work:

proc means.......

format

BLANKCHECK1 CBOARD1 LSPMT1 LWCNST1 COMPPLAN1 DIRIND1 DIRLIAB1 GOLDENPARACHUTE1 SEVERANCE1 CUMVOTE1

    CUMVOTESS1 LABYLW1 LACHTR1 SECRETBALLOT1 SUPERMAJOR1 UNEQVOTE1 ANTIGREEN1 DUTIESNF1 FAIRPRICE1 PPARACHUTE1

    PPILL1 SPARACHUTE1 SL_BUSCOMP1 SL_CASHOUT1 SL_CSA1 SL_DUTIES1 SL_FAIRPRICE1 SL_RPROFITS1  8.;

var...........

SAS assumes the format of a variable if it is not explicitly defined.

View solution in original post


All Replies
Super User
Posts: 10,458

Re: Help for a new SAS user- ERROR: Asterisks are an indication of a format width problem

Often if a variable has a permanent format assigned then procedures will attempt to use that format by default, such as means or VIEWTABLE.

Try

Proc print data=governancedropt1_byyear;

format _numeric_ best8. ;

run;

and see if that will get closer to what you are looking for.

or turn of the noprint.

You can also change the view within viewtable by clicking on the column heading and editing the format but if you have enough variables that's a tad tedious. You can also use proc datasets to change the format(s) of variables in place either on the input data set or the result.

Solution
‎04-02-2015 01:01 PM
Regular Contributor
Posts: 217

Re: Help for a new SAS user- ERROR: Asterisks are an indication of a format width problem

Perhaps this will work:

proc means.......

format

BLANKCHECK1 CBOARD1 LSPMT1 LWCNST1 COMPPLAN1 DIRIND1 DIRLIAB1 GOLDENPARACHUTE1 SEVERANCE1 CUMVOTE1

    CUMVOTESS1 LABYLW1 LACHTR1 SECRETBALLOT1 SUPERMAJOR1 UNEQVOTE1 ANTIGREEN1 DUTIESNF1 FAIRPRICE1 PPARACHUTE1

    PPILL1 SPARACHUTE1 SL_BUSCOMP1 SL_CASHOUT1 SL_CSA1 SL_DUTIES1 SL_FAIRPRICE1 SL_RPROFITS1  8.;

var...........

SAS assumes the format of a variable if it is not explicitly defined.

Occasional Contributor
Posts: 17

Re: Help for a new SAS user- ERROR: Asterisks are an indication of a format width problem

Jwillis, thanks for your help, it works. And I have transpose the data to replicate a data table that I am learning from.

1) How do I get sub headings? eg, as in the screenshot, I need "delay" to indicate it is the heading for blank check-written consent etc...

2) How to add in another row "number of firms" at the bottom of the table?

Contributor
Posts: 29

Re: Help for a new SAS user- ERROR: Asterisks are an indication of a format width problem

I have the same problem with indicator variables that I build, where I spesify the format as "1." and then the proc means gives me issues.

What you can do, though I do not know of any consequences of this:

 

proc means data= a;

 format _all_;

 informat _all_;

 class xxx;

 var yyy;

 output out=b sum=yyy;

run;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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