BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zimcom
Pyrite | Level 9

 

 

Greeting!!

 

what I have

shipping datesiteSubject IDSiteIntialDate
2017-03-011100101-Mar-17
2017-03-0111002.
2017-03-0711003.
2018-11-1411062.
2018-11-1911063.
2018-12-0211064.
2018-01-092200109-Jan-18
2018-02-0222002.
2018-03-0522003.
2018-12-1922030.
2019-01-0322031.
2017-07-073300107-Jul-17
2017-11-2933002.
2017-12-1233003.
2017-09-284400128-Sep-17
2017-12-1444002.
2017-12-2044003.
2018-02-0144004.
2018-02-0544005.
2018-03-2844006.
2018-05-1444007.

 

what I want 

Shipping datesiteSubject IDSiteIntialDate
2017-03-011100101-Mar-17
2017-03-011100201-Mar-17
2017-03-071100301-Mar-17
2018-11-141106201-Mar-17
2018-11-191106301-Mar-17
2018-12-021106401-Mar-17
2018-01-092200109-Jan-18
2018-02-022200209-Jan-18
2018-03-052200309-Jan-18
2018-12-192203009-Jan-18
2019-01-032203109-Jan-18
2017-07-073300107-Jul-17
2017-11-293300207-Jul-17
2017-12-123300307-Jul-17
2017-09-284400128-Sep-17
2017-12-144400228-Sep-17
2017-12-204400328-Sep-17
2018-02-014400428-Sep-17
2018-02-054400528-Sep-17
2018-03-284400628-Sep-17
2018-05-144400728-Sep-17

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

data have;
input shipping_date :yymmdd10.	site $	SubjectID $	SiteIntialDate :date9.;
format shipping_date yymmdd10. SiteIntialDate date11.;
cards;
2017-03-01	1	1001	01-Mar-17
2017-03-01	1	1002	.
2017-03-07	1	1003	.
2018-11-14	1	1062	.
2018-11-19	1	1063	.
2018-12-02	1	1064	.
2018-01-09	2	2001	09-Jan-18
2018-02-02	2	2002	.
2018-03-05	2	2003	.
2018-12-19	2	2030	.
2019-01-03	2	2031	.
2017-07-07	3	3001	07-Jul-17
2017-11-29	3	3002	.
2017-12-12	3	3003	.
2017-09-28	4	4001	28-Sep-17
2017-12-14	4	4002	.
2017-12-20	4	4003	.
2018-02-01	4	4004	.
2018-02-05	4	4005	.
2018-03-28	4	4006	.
2018-05-14	4	4007	.
;

data want;
 update have(obs=0) have;
 by site;
 output;
run;

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

data have;
input shipping_date :yymmdd10.	site $	SubjectID $	SiteIntialDate :date9.;
format shipping_date yymmdd10. SiteIntialDate date11.;
cards;
2017-03-01	1	1001	01-Mar-17
2017-03-01	1	1002	.
2017-03-07	1	1003	.
2018-11-14	1	1062	.
2018-11-19	1	1063	.
2018-12-02	1	1064	.
2018-01-09	2	2001	09-Jan-18
2018-02-02	2	2002	.
2018-03-05	2	2003	.
2018-12-19	2	2030	.
2019-01-03	2	2031	.
2017-07-07	3	3001	07-Jul-17
2017-11-29	3	3002	.
2017-12-12	3	3003	.
2017-09-28	4	4001	28-Sep-17
2017-12-14	4	4002	.
2017-12-20	4	4003	.
2018-02-01	4	4004	.
2018-02-05	4	4005	.
2018-03-28	4	4006	.
2018-05-14	4	4007	.
;

data want;
 update have(obs=0) have;
 by site;
 output;
run;
zimcom
Pyrite | Level 9

thank you @novinosrin, !!!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 857 views
  • 1 like
  • 2 in conversation