BookmarkSubscribeRSS Feed
jovic92
Obsidian | Level 7

Hi everyone,

 

I need help with SAS Event Stream Processing studio programming. Not sure if I select the right location for question. 

 

Maybe I will have two or three questions, but also, maybe after this one everything will be more clear for me.

 

I need to create some trigger for first call of user in a day. I have phone number, id, call start time, call end time, etc. I have CDRs files (csv format) coming every 3 minutes into Data Source window in ESP. 

Was thinking about creating a new, empty table to store USER ID right after some USER appears in CDRs and for each record checking if it's already stored (triggered) or not. 

All data in that table need to be deleted in 11:59 PM. 

 

Not sure where to started or which windows to use. Is it possible to create that through Compute or Procedural windows and if someone has any example would be really helpful. 

 

I hope I didn't break any rules of posting a questions in community, if I do, I will edit. 

 

Any kind of help is welcomed.

Thanks in advance.  

8 REPLIES 8
ChrisNZ
Tourmaline | Level 20

This

I have phone number, id, call start time, call end time, etc. I have CDRs files (csv format) coming every 3 minutes into Data Source window in ESP. 

Was thinking about creating a new, empty table to store USER ID right after some USER appears in CDRs and for each record checking if it's already stored (triggered) or not. 

All data in that table need to be deleted in 11:59 PM. 

is not enough information.

 

Please provide example input data and expected output.

LinusH
Tourmaline | Level 20
@ChrisNZ ESP doesn't build upon SAS Foundation so the usual sample input/output data requirement might not be applicable here.

@jovic92 to me it sounds you need direction to get started. The communities might not be the best place to get a wide set of knowledge. It's more suited for specific problems.
If you not have already done so, check out all the ESP resources at support.sas.com, like documentation, training, demos, papers etc. You can also contact your local SAS they should be more than happy to get you going.
Data never sleeps
jovic92
Obsidian | Level 7

@LinusH Yes, you are right, not sure how can I provide a input/output data/ 

There is only columns with names I provided, that's all. 

 

Now I have a more specific question. I have started something on my own and found another approach, but there is a problem with getting the current time. With function today() I can get current datetime, but there is no example to extract hour and minutes from that.

I have tried everything I run into it but nothing really works. Expression language, Data Flux is used in Compute window in ESP. 

 

Here is the documentation, but all examples are about date (year, month, day) not even one is about time. 

https://support.sas.com/documentation/onlinedoc/dfdmstudio/2.3/dfU_ELRG.pdf

 

Are you in SAS ESP? 

 

Thanks,

LinusH
Tourmaline | Level 20

No, I'm not.

 

According to that documentation, you can use the formatdate function, and chose a time format.

Even if there is no example for time, I would guess that you use the parameters you want, and format accordingely (similar to the date examples). I would try "HH:MM" for instance if you want to extract that part.

Can you show what you have tried, and result/how it's not working?

Data never sleeps
jovic92
Obsidian | Level 7

I have tried with: 

 

Time_flag = today()

 

formatdate('Time_flag',"hh:mm")

 

formatdate('Time_flag',"mm")

formatdate(today()',"mm")

 

formatdate('Time_flag',"hh")

 

But I got empty cells. Only Time_flag = today() works as expected. 

 

 

LinusH
Tourmaline | Level 20

And it's not that simple that you need to supply upper case literals...?

Data never sleeps
jovic92
Obsidian | Level 7

Actually, here is docs:

 

Details

The format parameter can include any string, but the following strings are replaced with the specified values:
YYYY: four-digit year
YY: two-digit year
MMMM: full month in proper case
MMM: abbreviated three-letter month
MM: two-digit month
DD: two-digit day
hh: hour
mm: minute
ss: second
ms: millisecond
 
Note: The format parameters are case sensitive.
LinusH
Tourmaline | Level 20

Ah, sorry.

if you are following the documentation thoroughly, try open a ticket to SAS tech support.

Data never sleeps

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 8 replies
  • 1257 views
  • 1 like
  • 3 in conversation