BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

What is the way to create data sets : "wanted1"  and "wanted2" 

from data sets "Rawtbl" and "start_end_tbl"?

 

 

Data start_end_tbl;
input ID start end ;
999 1904 1906
888 1906 1908 
;
Run;


Data Rawtbl;
input ID start end mon t;
cards;
999 1901 1
999 1902 3
999 1903 5
999 1904 7
999 1905 9
999 1906 2
999 1907 4
999 1908 6
999 1909 2
999 1910 7
999 1911 9
999 1912 4
888 1901 3
888 1902 5
888 1903 2
888 1904 1
888 1905 6
888 1906 1
888 1907 2
888 1908 8
888 1909 9
888 1910 1
888 1911 8
888 1912 7
;
run;

Data wanted1;
input ID start end Total_Start_to_end;
cards;
999 1904 1906 18
888 1906 1908 11
;
Run;
 

Data wanted2;
input ID start end L1 L2 L3;
cards;
999 1904 1906 7 9 2
888 1906 1908 1 2 8
;
Run;


 

 

2 REPLIES 2
ballardw
Super User

Time series should use some form of actual date, time or datetime value.

 

None of 999, 888, or 1904 is a date. So what "series"?

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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