SAS Viya Copilot for Code Assistance in SAS Data and AI Studio
Recent Library Articles
In this post, we’ll take a look at how SAS Viya Copilot for Code Assistance can help with some of those everyday tasks: understanding code, improving it, and making changes more confidently—all without leaving the SAS Data and AI Studio environment.
I have 500 observations, each of which has two measurements [offmm_ind and delta].
The dataset is attached below.
How to generate 2D histogram/heatmap?! Thanks,
... View more
I am stuck on a problem and I thought I knew how to do a data step. The problem is that because no two examples are exactly alike, one data step doesn't really apply to another data step. The file is in the library instead of the filing source in my class. Should I drop the class?
... View more
Learn how Istanbul saved 2.9 million Turkish liras by finding the most efficient driver/bus/service assignments to minimize running costs.
... View more
SAS V9.4. I'm stumped. I have a small file containing error messages from an IBM z/OS utility. I am reading a file that is the SYSPRINT messages from an IDCAMS DCOLLECT run. I have multiple types of records, and delete what I consider trash - for example, the first line. The records I want all begin with 'IDC11808I' but the record is spread across two lines. One field on the first line is a dataset name(Bad_VVR_DSN) and can be up to 44 characters long. After each dataset name is ' ON ' followed by a 6-character volser. I read the dataset name (Bad_VVR_DSN) and use an '@' to hold the record. I then do on_ix = index(Full_Rec,' ON '); I then have VOL_START = on_ix + 4. Followed by INPUT @(VOL_START) volser $char6.; But I'm not getting the value for volser off most of the records. I also only see half my records (that is, I know there are 8 problems and only see 4 of them). For example, in the file Lloyd_C_DCOLLECT_SYSPRINT.txt there is a pair of records for Bad_VVR_DSN = LLOYD.CWC.GLOBAL.CSI.BKUP.DATA and it shows in the SASPRINT. There is also a pair of lines for LLOYDC.CWC.GLOBAL.CSI.BKUP.INDEX but that is not in the output. The SAS code is in Lloyd_C_DCOLLECT_BADVVR.txt. I output the full record in the SASLOG. Why is the INPUT @VOL_START not resulting in a value for most of the records? Why am I only seeing half of my input records?
... View more
I have column with Groups[1,2,3,4,5,.....N]. and need do some simple investigation, what combination
of 1,2,3,...,N offers the best outcome.
So I write one macro. BUT more than one groups means the passed-through parameter with ",", which
is complained. The simulation code is below.
How to skip this? Is possible with macro?!
data have;
do grp =1 to 20;
do ind=1 to 100;
y=ranuni(ind)+ grp;
output;
end;
end;
run;quit;
%macro m_test(grps, grps_note);
proc sql;
create table out_grp_&grps_note. as
select avg(y) as y
from have where grp in (&grps.);
quit;
data out_grp_&grps_note.;
set out_grp_&grps_note.;
groups="&grps.";
run;quit;
%mend;
%let grps=2;
%let grps_note=g2;
%m_test(&grps.,&grps_note.);
/*complains if grps with ","[more than one value]*/
%let grps=2,3;
%let grps_note=g23;
%m_test(&grps.,&grps_note.);
... View more