Hello all,
I've 30 pressure values of 30 locations at the same timestamp hourly (see Image)
Desire output is p1 and p2
If time is 60 min then take p2 as the next interval of hour of Pressure value and assign that particular row Pressure value as P1.
Note: time interval may be more than 1 hr from one station to another station then take the previous one station pressure value as P2.
First thing, it is extremely hard to code against pictures and most of us do not have the time to attempt to enter your data by hand.
Second, I think you need to provide some details about exactly what " time is 60 min then take p2 as the next interval of hour of Pressure value and assign that particular row Pressure value as P1." means. Your shown values encompass a time from of exactly 1 SECOND. So there is no chance of telling what "60 min" means.
Such as indicate which specific value by time is meant for your examples and provide them in example data. When you have same values in a single variable for multiple records it is extremely hard to tell which specific record a given value comes from.
And is your "pressure" a text or character variable? Are P1,P2 etc supposed to be numeric?
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the <> icon or attached as text to show exactly what you have and that we can test code against.
Hi sorry for the inconvenience,
I attached dummy data excel file.
I take 1st 300 observation
DateTime | SEQ | P01 | Travel_Time_Minute | P02 |
01Jun2010 0:01:00 | 01 | 37 | ||
01Jun2010 0:01:00 | 02 | 32 | 13.37158349 | 40 |
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.