SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Using DS2 in SAS Event Stream Processing Studio

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Using DS2 in SAS Event Stream Processing Studio

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.


Accepted Solutions
Solution
‎03-15-2017 12:22 AM
SAS Employee
Posts: 5

Re: Using DS2 in SAS Event Stream Processing Studio

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


All Replies
Solution
‎03-15-2017 12:22 AM
SAS Employee
Posts: 5

Re: Using DS2 in SAS Event Stream Processing Studio

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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