Help using Base SAS procedures

CNTLIN FORMATS

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

CNTLIN FORMATS

Hi ,

I am using CNTLIN formats

I have a couple of questions regarding.

can you explain why the provider=label???

if I have several other variables X, Y, Z in the KEEP which variable of those will get the "=label"????? is there a preference ?

secondly what does that =label do????

Thanks

data test1(rename=(providerkey=start provider=label));

set dim_provider(keep=providerkey provider /*X Y Z*/);

fmtname='attprovkey';

run;

proc format cntlin=test1;run;

data both;

set hsp_acct_2;

attending_provider=put(providerattendingkey, attprovkey.);

run;


Accepted Solutions
Solution
‎06-10-2014 07:20 PM
Super User
Posts: 10,550

Re: CNTLIN FORMATS

I'm not sure what you are attempting in the long run.

There may be a case of mistaken identity. For CNTLIN data sets Label is an expected Variable. In many other places Label is the Text associated with a variable name. Yes any variable can have a label associeated. But the Variable named Label, which is a character variable, is what holds the text associeated with the values.

Did you create the CNTLout data set and look at it?

View solution in original post


All Replies
Super User
Posts: 10,550

Re: CNTLIN FORMATS

PROC Format requires a variable named LABEL to describe the display associated with the values in the Start and End. Variables that are not expected by Proc Format are ignored.

A better way to understand what is required may be to make a short custom format and use the CNTLOUT option to create a data set that describes the format. Then you will see a bit more clearly what the variables associated with a CNTLIN data set do.

Super Contributor
Posts: 1,040

Re: CNTLIN FORMATS


Hi,

I was thinking I could use label on any of the variables on the Keep statement!!!!

Please correct?

Thanks

Solution
‎06-10-2014 07:20 PM
Super User
Posts: 10,550

Re: CNTLIN FORMATS

I'm not sure what you are attempting in the long run.

There may be a case of mistaken identity. For CNTLIN data sets Label is an expected Variable. In many other places Label is the Text associated with a variable name. Yes any variable can have a label associeated. But the Variable named Label, which is a character variable, is what holds the text associeated with the values.

Did you create the CNTLout data set and look at it?

Super User
Posts: 3,115

Re: CNTLIN FORMATS

Looking at an example in the SAS documentation should help. Also try running the example program and examining the CNTLIN dataset.

http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n1e19y6lrektafn1kj6nb...


🔒 This topic is solved and locked.

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

Discussion stats
  • 4 replies
  • 186 views
  • 6 likes
  • 3 in conversation