BookmarkSubscribeRSS Feed
amanjot_42
Fluorite | Level 6

Hi,

Thanks for the help!

 

I have noticed, there is another column of audit year which looks like below. I want to create a dummy, where year=audit_year.

 

Firm ID  Year    Audit_year        Dummy (what I want)
11 1990 . 0 11 1991 . 0 11 1992 1993 0 11 1993 . 1 11 1994 1995 0 11 1995 . 1 11 1996 . 0 12 2001 . 0 12 2002 2003 0 12 2003 . 1 12 2004 . 0 12 2005 . 0 12 2006 . 0 12 2007 . 0 12 2008 . 0 12 2009 . 0

In the latter table, audit years are one year ahead of YEAR. Please help with respect to the codes

Regards,
Amanjot

 

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

So you want dummy=1 if Audit_Year is not missing in the previous obs?

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1 reply
  • 749 views
  • 0 likes
  • 2 in conversation