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

Dear community

I've created a lot of numeric variables with the following naming convention: TIME[WEEK][WEEKDAY][HOUR][STATUS]

[week] has 2 digits, [weekday] 1 digit, [hour] 2 digits, [status] 1 digit (1/2 dummy).

Ex: August 13 10 AM would be named: TIME334102 ( I use European calendar and week calculations).

In the variables I've stored minute values ranging from 0 to 60.

I would for instance like to sum all TIME variables with [weekday]=4.

Can this be done?

I know the   array num_vars

  • _NUMERIC_; function and the OF operator, but I'm missing some pieces in the puzzle.
  • Any help is appreciated.

    Thank you.

    1 ACCEPTED SOLUTION

    Accepted Solutions
    ballardw
    Super User

    Some example of what your data actually looks like would be helpful.

    Depending on what your project started with you might have been better off with single variable for date/time and another for what ever you want to sum. If all of your summary activities are going to work around ideas like week of year, day of week then a date variable might suffice.

    If you have a date variable then you can inspect that easily with functions such as Year, Month, Day and such and often summarize with other procedures by assigning a format to the date variable to create groups.

    View solution in original post

    2 REPLIES 2
    ballardw
    Super User

    Some example of what your data actually looks like would be helpful.

    Depending on what your project started with you might have been better off with single variable for date/time and another for what ever you want to sum. If all of your summary activities are going to work around ideas like week of year, day of week then a date variable might suffice.

    If you have a date variable then you can inspect that easily with functions such as Year, Month, Day and such and often summarize with other procedures by assigning a format to the date variable to create groups.

    Boka98
    Calcite | Level 5

    Hi

    I actually solved my problem right after posting it.

    Seems that just to formulate the problem helped me solve it.

    Thank you anyway.

    sas-innovate-2024.png

    Don't miss out on SAS Innovate - Register now for the FREE Livestream!

    Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

     

    Register now!

    SAS Enterprise Guide vs. SAS Studio

    What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

    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
    • 899 views
    • 0 likes
    • 2 in conversation