- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
cust_id date1 date2 date3
1001 15JAN2023 20FEB2023 30MAR2023
I want an ouput like
cust_id date1 date2 date3 date 4
1001 15JAN2023 20FEB2023 30MAR2023 15JAN2023
1001 15JAN2023 20FEB2023 30MAR2023 20FEB2023
if you guys see date1 and date2 are appended against date3
like that i want an output
i have dataset of 15000 rows
kindly guide me here
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you want a third row with the value of date3 also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@carl_miles wrote:
cust_id date1 date2 date3
1001 15JAN2023 20FEB2023 30MAR2023
I want an ouput likecust_id date1 date2 date3 date 4
1001 15JAN2023 20FEB2023 30MAR2023 15JAN2023
1001 15JAN2023 20FEB2023 30MAR2023 20FEB2023
if you guys see date1 and date2 are appended against date3
like that i want an output
i have dataset of 15000 rows
kindly guide me here
I feel like I don't understand where date4 comes from, or why it is needed. I don't understand how many rows will be created from this initial one row data set. What happens if there are more CUST_ID values, then what?
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@carl_miles wrote:
ITS FINE
This extreme level of brevity does not help me understand the problem.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can see the lack of specific suggestions in the responses to your posting.
I think this is primarily due to the absence of a clear description (or of any description at all) of your objective.
I suspect for every incoming observation, you want to generate two observations, one with DATE4=DATE1, and the second with DATE4=DATE2. But that notion is nothing more than an attempt at mindreading, a skill I do not trust.
If you can clearly state what you want to dio you would get a lot more help. Please help us help you.
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This accomplishes what you ask for the shown values.
First is a data step to actually have values.
data have; input cust_id date1 :date9. date2 :date9. date3 :Date9.; format date: date9.; datalines; 1001 15JAN2023 20FEB2023 30MAR2023 ; data want; set have; array d (*) date1 date2; do i= 1 to dim(d); date4=d[i]; output; end; format date4 date9.; drop i; run;
Why? I don't see any practical use.
What do you intend to do with the resulting set? It may be this step just adds complications on the way to your goal.