SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
vskon
Calcite | Level 5
The following is my Input 
 
 
INPUT
 
 
 
 
 
 
 
id
email
date
1
 
1/1/2020
1
a@gmail.com
1/2/2020
1
 
1/3/2020
1
 
1/4/2020
1
 
1/5/2020
1
b@gmail.com
1/6/2020
1
 
1/7/2020
2
c@gmail.com
1/1/2020
2
 
1/2/2020
2
 
1/3/2020
2
 
1/4/2020
2
 
1/5/2020
2
d@gmail.com
1/6/2020
2
 
1/7/2020
2
 
1/8/2020
2
 
1/9/2020
and I am trying to achieve the below output using SAS. 
 
 
OUTPUT
 
 
 
 
 
 
 
id
email
date
1
a@gmail.com
1/1/2020
1
a@gmail.com
1/2/2020
1
a@gmail.com
1/3/2020
1
a@gmail.com
1/4/2020
1
a@gmail.com
1/5/2020
1
b@gmail.com
1/6/2020
1
b@gmail.com
1/7/2020
2
c@gmail.com
1/1/2020
2
c@gmail.com
1/2/2020
2
c@gmail.com
1/3/2020
2
c@gmail.com
1/4/2020
2
c@gmail.com
1/5/2020
2
d@gmail.com
1/6/2020
2
d@gmail.com
1/7/2020
2
d@gmail.com
1/8/2020
2
d@gmail.com
1/9/2020
 
Please suggest.
 
Thank you in advance
2 REPLIES 2
brzcol
SAS Employee

Hi,

Thank you for posting a picture of some sample data. I have a few questions for you:

  • Is the data coming from an Excel spreadsheet, csv file, etc?
  • In your data, will the email for row 1 always be missing?
  • What is the relationship between the ID and the emails? I noticed the emails for A and B both correspond to ID 1. 
  • Is the purpose to create a new table or a report?
  • What code have you tried thus far?
PaigeMiller
Diamond | Level 26

@vskon Please help everyone out by changing the Subject on your original post to something that describes the problem. "SAS Code" is not a meaningful description. Something like "Filling in Blank Lines" would be a much better subject, it is a meaningful description of your problem, and it allows the SAS Community to operate more efficiently, people with a similar problem can see this meaningful subject line and read the responses.

--
Paige Miller

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 2 replies
  • 732 views
  • 0 likes
  • 3 in conversation