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

HI THERE,

I AM TRYING TO EXTRACT A SAMPLE OF FIRMS (WITH THE SAME PERMNO) THAT EXIST FROM FYEAR FROM 2001 TO 2011 AND DELETE THE FIRMS  THAT HAS   MISSING FYEAR AT THE BEGINNING (2001) OR AT THE END (2011) OR IN BETWEEN.

THNAK yOU FOR THE SUPPORT.

P

1 ACCEPTED SOLUTION

Accepted Solutions
AncaTilea
Pyrite | Level 9

Could you explain this a bit more:

"THAT HAS   MISSING FYEAR AT THE BEGINNING (2001) OR AT THE END (2011)"

FYEAR takes values 2001 to 2011. If it's missing....How does one know that is 2001 missing? and not 2002??

Could you provide a small sample data?

View solution in original post

3 REPLIES 3
AncaTilea
Pyrite | Level 9

Could you explain this a bit more:

"THAT HAS   MISSING FYEAR AT THE BEGINNING (2001) OR AT THE END (2011)"

FYEAR takes values 2001 to 2011. If it's missing....How does one know that is 2001 missing? and not 2002??

Could you provide a small sample data?

RichardinOz
Quartz | Level 8

I think this is the answer:  count the number of records with years between 2001 and 2011, and only keep those where the result is 11

Proc SQL ;

     Crate table want as

          Select id

           From

                    (Select id

                         ,      count (distinct FYear) as count

                    From     have (where = (FYear between 2001 and 2011))

                    )

          Where     count = 11

          ;

Quit ;

(Untested code)

Richard

pras3
Calcite | Level 5

Dear anca tilea,

I have attached the sample dataset.

The dataset is a sub-sample data that only include low growth firms. However there are firms  which are not consistenly falling  within the low growth category  from 2001 to 2011 and have missing  data in the dataset for few years.As firms can also be facing high growth between 2001 and 2010. I need to select firms which are consistently low growth between  from 2001 and 2011 from this sample data.

Thank You.

regds

p

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
  • 3 replies
  • 1248 views
  • 3 likes
  • 3 in conversation