BookmarkSubscribeRSS Feed
Go210
Obsidian | Level 7

Hi all,

 

I have struck a problem and need your help.

 

I have a dataset with Date, Index, Month, Year, Name_Code, ID, ID_Name, Value.

 

Date is just a month and year which have been translated into the variables Month & Year.

 

Index represents a block of date range that is the same date range all the way through the dataset. (Repeated every time the index is incremented)

 

Now, I have lots of blank space in between the Index. At some point I will have a value for Name_Code, ID, ID_Name, Value contained within the index. This will then need to be used to fill white space within the index. Now the difficulty is that there is sometimes more than one full observation within the index (100+) that will need to fill the white space until another full observation or until the end of the index.

 

Any help would be greatly appreciated.

 

 

Have:       
DateIndexMonthYearName_CodeIDID_NameValue
Jan-03112003 . .
Feb-03122003 . .
Mar-03132003 . .
Apr-03142003John45Teacher101
May-03152003 . .
       
Jan-03212003 . .
Feb-03222003Bill98Engineer76
Mar-03232003Bill98Engineer80
Apr-03242003 . .
….       
        
Want:       
DateIndexMonthYearName_CodeIDID_NameValue
Jan-03112003John45Teacher101
Feb-03122003John45Teacher101
Mar-03132003John45Teacher101
Apr-03142003John45Teacher101
May-03152003John45Teacher101
       
Jan-03212003Bill98Engineer76
Feb-03222003Bill98Engineer76
Mar-03232003Bill98Engineer80
Apr-03242003Bill98Engineer80
1 REPLY 1
ChrisNZ
Tourmaline | Level 20

How do you fill this?

 

Jan-03 2 1 2003   .   .
Feb-03 2 2 2003 Bill 98 Engineer 76
Mar-03 2 3 2003        
Apr-03 2 4 2003   .   .
May-03 2 5 2003   .   .
Jun-03 2 6 2003        
Jul-03 2 7 2003 Bill 98 Engineer 80
Aug-03 2 8 2003   .   .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 609 views
  • 0 likes
  • 2 in conversation