BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Image i have a table like that:

cod date mov term_date begin_date
1 24MAY2009 0 . .
1 25MAY2009 1 . 25MAY2009
1 26MAY2009 0 . .
1 27MAY2009 2 . .
1 28MAY2009 0 . .
1 29MAY2009 1 29MAY2009 .
1 30MAY2009 1 . .

I want to extract the data set that is between the variable begin_date and term_date and to fill out it with the existent dates in the variable dates.

How can i do it? Thanks
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
Your request has multiple interpretations. Perhaps you could show what you wnt the ending dataset to look like.
deleted_user
Not applicable
Hi all,

I want this final dataset:

cod date mov term_date begin_date new_variable
1 25MAY2009 1 . 25MAY2009 25MAY2009
1 26MAY2009 0 . . 26MAY2009
1 27MAY2009 2 . . 27MAY2009
1 28MAY2009 0 . . 28MAY2009
1 29MAY2009 1 29MAY2009 . 29MAY2009

I try to use first and last procedure but i need to have this output at new_variable.

Thanks
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Creating a new SAS variable is basic DATA step programming with SAS. What code, if any, have you tried? Can you share that code for feedback? If you need to assign a new variable, you can do so in a SAS DATA step and since the variable is a DATE, you will want to assign a FORMAT statement to the variable (or use a singe ATTRIB statement).

I have provided a SAS-hosted documentation link below -- also, the SAS support http://support.sas.com/ website has very useful information as technical and conference topic-related references, which you can find using the SEARCH facility.

Scott Barry
SBBWorks, Inc.

Introduction to DATA Step Processing
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001302699.htm

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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