Hello,
I would like to insert additional numbers between the values in my sample dataset with a 1-unit interval. Please help, thanks.
data HAVE;
Format Weekcode 4.0 Test 3.0 Pos 3.0 Lab 4.0;
infile datalines delimiter='/';
input Weekcode Test Pos Lab;
datalines;
2102/ 8/ 3/ 256/
2103/ 3/ 1/ 619/
2106/ 5/ 2/ 2066/
2107/ 3/ 0/ 256/
2110/ 7/ 6/ 619/
;
data WANT;
Format Weekcode 4.0 Test 3.0 Pos 3.0 Lab 4.0;
infile datalines delimiter='/';
input Weekcode Test Pos Lab;
datalines;
2101/ 0/ 0/ 0/
2102/ 8/ 3/ 256/
2103/ 3/ 1/ 619/
2104/ 0/ 0/ 0/
2105/ 0/ 0/ 0/
2106/ 5/ 2/ 2066/
2107/ 3/ 0/ 256/
2108/ 0/ 0/ 0/
2109/ 0/ 0/ 0/
2110/ 7/ 6/ 619/
2111/ 0/ 0/ 0/
2112/ 0/ 0/ 0/
2113/ 0/ 0/ 0/
2114/ 0/ 0/ 0/
2115/ 0/ 0/ 0/
;
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.
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.