01-29-2025
Mayt
Quartz | Level 8
Member since
02-23-2023
- 56 Posts
- 10 Likes Given
- 1 Solutions
- 3 Likes Received
-
Latest posts by Mayt
Subject Views Posted 1387 09-25-2024 07:50 AM 1433 09-25-2024 05:11 AM 4727 09-25-2024 05:00 AM 4884 09-17-2024 11:32 PM 4889 09-17-2024 11:27 PM 4957 09-17-2024 05:05 AM 2792 07-26-2024 05:20 AM 2795 07-26-2024 05:18 AM 2913 07-24-2024 10:33 AM 3067 07-23-2024 03:49 AM -
Activity Feed for Mayt
- Posted Re: Do SAS Intelligent Decision have distinct/group by function for datagrid? on Decisioning. 09-25-2024 07:50 AM
- Posted Do SAS Intelligent Decision have distinct/group by function for datagrid? on Decisioning. 09-25-2024 05:11 AM
- Posted Re: Can we export custom function of SAS intelligent decision : SAS viya on Decisioning. 09-25-2024 05:00 AM
- Liked Re: Can we export custom function of SAS intelligent decision : SAS viya? for alexal. 09-25-2024 05:00 AM
- Liked Re: Can we export custom function of SAS intelligent decision : SAS viya for alexal. 09-25-2024 05:00 AM
- Posted Re: Can we export custom function of SAS intelligent decision : SAS viya on Decisioning. 09-17-2024 11:32 PM
- Posted Re: Can we export custom function of SAS intelligent decision : SAS viya? on Decisioning. 09-17-2024 11:27 PM
- Posted Can we export custom function of SAS intelligent decision : SAS viya? on Decisioning. 09-17-2024 05:05 AM
- Got a Like for Execute jobs/flows viya through REST API. 08-08-2024 11:56 AM
- Posted Re: Can we write SQL in SAS intelligent Decision? on Decisioning. 07-26-2024 05:20 AM
- Posted Re: Can we write SQL in SAS intelligent Decision? on Decisioning. 07-26-2024 05:18 AM
- Posted Can we write SQL in SAS intelligent Decision? on Decisioning. 07-24-2024 10:33 AM
- Liked Creating Custom Functions in SAS Intelligent Decisioning for TwandaBaker. 07-23-2024 05:30 AM
- Posted Re: How to convert data to date/datetime in sas decision? on Decisioning. 07-23-2024 03:49 AM
- Posted Re: How to convert data to date/datetime in sas decision? on Decisioning. 07-23-2024 03:47 AM
- Posted How to convert data to date/datetime in sas decision? on Decisioning. 07-11-2024 01:22 PM
- Liked Re: can we call api in sas intelligent decision with xml format as input and output? for alexal. 07-11-2024 12:41 PM
- Posted Re: can we call api in sas intelligent decision with xml format as input and output? on Decisioning. 05-02-2024 09:56 AM
- Posted Re: Can we prevent publishing intelligent decision with the same name if publishers are different us on Decisioning. 05-02-2024 06:18 AM
- Posted can we call api in sas intelligent decision with xml format as input and output? on Decisioning. 05-02-2024 06:18 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 3 1 1 -
My Liked Posts
Subject Likes Posted 1 01-29-2024 04:05 AM 1 08-08-2023 04:13 AM 1 08-01-2023 11:02 PM
09-25-2024
07:50 AM
well, in the document i provided earlier it's about counting distinct row in table. I tried using it and it returned a count of distinct row, but the datagrid still have the same data as before being distincted. And for group by function, I want to use it when it come to aggregate scenario.
... View more
09-25-2024
05:11 AM
Hi everyone!!
I want to use distinct/group by function for datagrid in SAS intelligent Decision. But I found only datagrid_distinctrowcount function which merely return the number of unique rows in the specified data grid. If you guys have any recommendation, please let me know. Thank you in advanced!!
... View more
09-17-2024
11:32 PM
This one is Long-Term Support 2022.09. Also I have another SAS Intelligent Decision license which version is Stable 2024.06, and custom function cannot be exported either.
... View more
09-17-2024
11:27 PM
This one is Long-Term Support 2022.09. Also I have another SAS Intelligent Decision license which version is Stable 2024.06, and custom function cannot be exported either.
... View more
09-17-2024
05:05 AM
Hi guy!
I have trouble exporting custom function of SAS intelligent decision. I can't find the location of these custom functions, I tried searching in SAS environment manager. I guess it doesn't reside to folder, right? So if you guys know how to export/import it. Please suggest me. Thank you in advance.
... View more
07-26-2024
05:20 AM
It seem I need to use that code in sas studio. Can I use it in SAS ID?
... View more
07-26-2024
05:18 AM
I can't use it in ds2 in SAS ID
package "${PACKAGE_NAME}" /inline;
method execute();
/* Make some test data */
data one;
do ID=1 to 20;
Text1='One';
output;
end;
run;
data two;
do ID=1 to 20 by 2;
Text2='Two';
output;
end;
run;
/* Process SQL join result in DS2 */
proc ds2;
data result/overwrite=yes;
method run();
set {select one.ID, coalescec(text2,text1) as Text
from one left join two
on one.ID=two.ID};
end;
enddata;
run;
quit;
proc print data=result;
run;
end;
endpackage;
... View more
07-24-2024
10:33 AM
Currently, I am working on a SAS Intelligent Decision(SAS ID) project. The project needs to do some tasks involving using datagrid. In this project we use oracle database.
I know that SAS ID has sql code file. But it seems we can only perform simple sql statement to table in database. (ref sas doc ) I want to perform tasks such as receive datagrid as input then manipulate data and return output. So, I guess I may need to use ds2/custom functions in SAS ID.
Unfortunately, I find it very difficult to write ds2/custom functions to perform datagrid tasks such as join with condition. I tried to use datagrid functions, but it can’t replace SQL 100%. I doubt that can we write SQL within ds2 code files?
I have been suggested to write python in SAS ID to call function in oracle. But for some reason I can’t use python right now.
Here my questions:
Can I write SQL within ds2 code files?
Is there anyway to perform sql statement to datagrid?
Or if you have any other suggestion please tell me.
Here are example tasks that I want to perform in SAS ID:
an example is written in microsoft sql language. It's quite simple, but there are some tasks that more complex and it would be easier to code in sql. That why I want to use SQL.
CREATE FUNCTION [dbo].[function_A]
(
-- Add the parameters for the function here
@Appkey NVARCHAR(34)
)
RETURNS SMALLINT
AS
BEGIN
DECLARE @Counter SMALLINT
SELECT @Counter = SUM(
CASE WHEN COL_A > 0 THEN 1
WHEN COL_B > 0 THEN 1
WHEN COL_C > 0 THEN 1
WHEN COL_D > 0 THEN 1
ELSE 0 END) FROM TABLE_A a left join TABLE_B b on a.col_name = b.col_name WITH (NOLOCK) WHERE Appkey = @Appkey
-- Return the result of the function
RETURN @Counter
END
GO
... View more
07-23-2024
03:49 AM
Here I found a solution. It works!!
package "${PACKAGE_NAME}" /inline;
method execute(in_out double sasdtvalue,
in_out double sasdtval,
in_out double sasd,
in_out double sastm,
in_out varchar fmtdate,
in_out varchar fmttime,
in_out varchar fmtdt,
in_out varchar datewithtime,
in_out double mon,
in_out double d,
in_out double y,
in_out double h,
in_out double m,
in_out double s);
dcl timestamp DS2ts ;
dcl varchar(32) expression;
re=prxparse('/(\d+)\/(\d+)\/(\d+)\s+(\d+):(\d+):(\d+)/');
if prxmatch(re, datewithtime) then
do;
d=prxposn(re, 1, datewithtime);
mon=prxposn(re, 2, datewithtime);
y=prxposn(re, 3, datewithtime);
h =prxposn(re, 4, datewithtime);
m =prxposn(re, 5, datewithtime);
s =prxposn(re, 6, datewithtime);
end;
h2s = h*60*60;
m2s = m*60;
fraction = h2s+m2s+s;
sasdtval = mdy(mon,d,y);
sasdtvalue = (sasdtval*86400)+fraction;
sasd = datepart(sasdtvalue);
sastm = timepart(sasdtvalue);
fmtdate = put(sasd, yymmdd10.);
fmttime = put(sastm, time.);
fmtdt = put(sasdtvalue, datetime21.7);
end;
endpackage;
... View more
07-23-2024
03:47 AM
Thank you so much for your reply. If I change format in sas studio then upload data to caslib, It will recognise data as date. But that means I need to prepare data in sas studio before use in decision. But I can't because I want to call decision through API and get results.
... View more
07-11-2024
01:22 PM
Hi everybody!
I need to use date/datetime data in sas intelligent decision. But if I import table to caslib My data will become varchar
mydata in excel:
in caslib:
And I found a solution to convert data to date/datetime from sas document Converting DS2 Date, Time, and Timestamp Values to SAS Date, Time, or Datetime Values
So I applied to ds2 code file in sas decision. It works, but I can't find any way to make it receive my date/datetime input.
Here is my initial code:
package "${PACKAGE_NAME}" /inline;
method execute(in_out double sasdtval,
in_out double sasd,
in_out double sastm,
in_out varchar fmtdate,
in_out varchar fmttime,
in_out varchar fmtdt
);
dcl timestamp DS2ts ;
DS2ts = timestamp '2012-06-04 10:54:34.012';
sasdtval = to_double(DS2ts);
sasd = datepart(sasdtval);
sastm = timepart(sasdtval);
fmtdate = put(sasd, yymmdd10.);
fmttime = put(sastm, time.);
fmtdt = put(sasdtval, datetime21.7);
end;
endpackage;
I adjusted it to receive datetime input ( DS2ts = timestamp datewithtime;) , and it raised error.
package "${PACKAGE_NAME}" /inline;
method execute(in_out double sasdtval,
in_out double sasd,
in_out double sastm,
in_out varchar fmtdate,
in_out varchar fmttime,
in_out varchar fmtdt,
in_out varchar datewithtime);
dcl timestamp DS2ts ;
DS2ts = timestamp datewithtime;
sasdtval = to_double(DS2ts);
sasd = datepart(sasdtval);
sastm = timepart(sasdtval);
fmtdate = put(sasd, yymmdd10.);
fmttime = put(sastm, time.);
fmtdt = put(sasdtval, datetime21.7);
end;
endpackage;
So If you guys know how to make it work, either needing to convert data in ds2 or another way, please let me know. Thank you in advanced 🙏
... View more
05-02-2024
06:18 AM
I found this link as tutorial for api calling in intelligent decision. Input is query and output is json format. But in my case, I want to send xml format as input and receive xml as output. If you guys know the solution, please let me know. Thank you in advance!
... View more