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

Hi All,

 

I am using proc ds2 code in Procedural Window in SAS Event Stream Processing 3.2.

The goal is to transpose the streaming data.But as we execute the procedural window , which consists of the code for transpose, it just stops responding.

My Source Data consists of 720 records and post transpose it should consists of 120 records.

Please find the code below:

ds2_options cdump;
data esp.out;
drop DeviceName Readings DeviceId;
declare double RPM;
declare double OPRESS;
declare double OLEVEL;
declare double OTEMP;
declare double NOISE;
declare double WTEMP;
method run();
set esp.in;
by TimeInterval;
if DeviceName='rpm' then RPM=Readings;
else if DeviceName='opress' then OPRESS=Readings;
else if DeviceName='olevel' then OLEVEL=Readings;
else if DeviceName='otemp' then OTEMP=Readings;
else if DeviceName='noise' then NOISE=Readings;
else if DeviceName='wtemp' then WTEMP=Readings;
if first.TimeInterval then output;
end;
enddata;

 

Seeking Your help and guidance.

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
RLigtenberg
SAS Employee

I believe the BY statement is not supported in SAS Event Stream Processing 3.2. Give this a try:

 

                    ds2_options cdump;

                    data esp.out;

                    declare double RPM;

                    declare double OPRESS;

                    declare double OLEVEL;

                    declare double OTEMP;

                    declare double NOISE;

                    declare double WTEMP;

                    retain RPM OPRESS OLEVEL OTEMP NOISE WTEMP;

                    method run();

                    set esp.in;

                    if DeviceName='rpm' then RPM=Readings;

                    else if DeviceName='opress' then OPRESS=Readings;

                    else if DeviceName='olevel' then OLEVEL=Readings;

                    else if DeviceName='otemp' then OTEMP=Readings;

                    else if DeviceName='noise' then NOISE=Readings;

                    else if DeviceName='wtemp' then do;

                            WTEMP=Readings;

                            output;

                        end;

                  end;

                  enddata;

 

Regards,

Robert

View solution in original post

1 REPLY 1
RLigtenberg
SAS Employee

I believe the BY statement is not supported in SAS Event Stream Processing 3.2. Give this a try:

 

                    ds2_options cdump;

                    data esp.out;

                    declare double RPM;

                    declare double OPRESS;

                    declare double OLEVEL;

                    declare double OTEMP;

                    declare double NOISE;

                    declare double WTEMP;

                    retain RPM OPRESS OLEVEL OTEMP NOISE WTEMP;

                    method run();

                    set esp.in;

                    if DeviceName='rpm' then RPM=Readings;

                    else if DeviceName='opress' then OPRESS=Readings;

                    else if DeviceName='olevel' then OLEVEL=Readings;

                    else if DeviceName='otemp' then OTEMP=Readings;

                    else if DeviceName='noise' then NOISE=Readings;

                    else if DeviceName='wtemp' then do;

                            WTEMP=Readings;

                            output;

                        end;

                  end;

                  enddata;

 

Regards,

Robert

Whether you're already using SAS Event Stream Processing or thinking about it, this is where you can connect with your peers, ask questions and find resources.

 

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1571 views
  • 2 likes
  • 2 in conversation