Recent Activity
Let's say that I write a module in SAS/IML that calls a second module. We can call them eponymously Module1 and Module2 without loss of generality. Let's say that Module 2 receives bad data from Module1 because I did not create good input data for Module 1. Oops! My bad. The IML interpreter complains and displays error diagnostics that reference the point of error in Module1. So far, so good. I find the line of code in Module1 and observe that it invokes Module2. Now, here is where I need help. The error diagnostics indicate that there is an offset point in Module2 that I assume will allow me to find the error in that module.
How do I use the information produced for Module2? I see an offset point and traceback information, but I don't know how to determine the line of code in Module2 that corresponds to this offset point. Also, how can I use the traceback information?
TIA,
Ross
... View more

0
0
I am sending SGPANEL output (along with some title and proc print output) to a PDF file. I have figured out all of the formatting except for two minor items. 1. At the bottom right of the SGPANEL output there is text "Page of" that I cannot get rid of. This is not the page label for the PDF pages, it is embedded in the SGPANEL output. The output chart is only one page and thus requires no pagination. The "Page of" text appears in both the PDF file and the HTML that shows up in Enterprise Guide. I am using SAS 9.4x. I do not want to format this item, I just want to remove it. 2. The COLAXIS label appears properly centered in the HTML output but in the PDF file it is centered on the bottom row of charts rather than across both rows of my two row/three column SGPANEL output. Here is the relevant code: ods pdf file="s:\want.pdf" startpage=no notoc dpi=600; ods graphics / reset=all height=4in width=6in noborder; ods escapechar = '^'; options nodate nonumber; %let VarName = SomeVariable; proc sgpanel data=&VarName._DistPct NOAUTOLEGEND; panelby As_of_Date / onepanel; styleattrs datacolors=(blue)wallcolor=pink; vbar &VarName._Bin / response=Percent group=ColorDummy; rowaxis grid label="Aggregate Current Balance Percentage" valuesformat=comma6.0 labelattrs=(size=12pt) labelpos=center; colaxis grid discreteorder=data fitpolicy=rotatethin label="&VarName." labelattrs=(size=15pt) valueattrs=(size=12pt); run; Some of the options may be unnecessary. I started throwing the kitchen sink at the problem when I could not find an answer in the documentation or forums. I appreciate your help and any references to appropriate documentation.
... View more

0
3
@Patrick I'm willing to learn hash objects.
I'm trying to replicate your proposal from a recent post where I complained about slow fedsql performance.
But it fails stating a 'The action stopped due to errors' message.
It's meant to replace the slow performing fedsql.
proc cas;
source ETL_AC;
create table PUBLIC.X_TEST1{options replace=true} as
select a.*, movave3_batch, movstd3_batch, movave&mov_minutes1., movstd&mov_minutes1., movave&mov_minutes2., movstd&mov_minutes2.
from CASUSER.TESTER1 a
left join &incas..MOVE_BATCH3_TR b
on a.batch_id=b.batch_id and a._NAME_=b.name
left join &incas..MOVE_MIN&mov_minutes1._TR c
on a.batch_id=c.batch_id and a._NAME_=c.name and a.datetime=c.datetime
left join &incas..MOVE_MIN&mov_minutes2._TR d
on a.batch_id=c.batch_id and a._NAME_=d.name and a.datetime=d.datetime
;
endsource;
fedSQL.execDirect / query=ETL_AC;
quit;
%let mov_minutes1=10;
%let mov_minutes2=30;
%let incas=public;
options mlogic symbolgen merror;
data PUBLIC.X_TEST1(drop=_rc copies=0 replace=yes );
if _N_ = 1 then do;
/* create variables */
if 0 then
do;
set
CASUSER.TESTER1
PUBLIC._MOVE_BATCH3_TR(keep=name BATCH_ID movave3_batch movstd3_batch rename=(name=_name_ ))
PUBLIC._MOVE_MIN10_TR (keep=name movave10 movstd10 BATCH_ID datetime rename=(name=_name_ ))
PUBLIC._MOVE_MIN30_TR (keep=name movave30 movstd30 BATCH_ID datetime rename=(name=_name_ ))
;
end;
/* define hash tables */
declare hash h_summary_a1(dataset: "&incas.._MOVE_BATCH3_TR(rename=(name=_name_ ))");
h_summary_a1.defineKey('batch_id', '_name_');
h_summary_a1.defineData('movave3_batch', 'movstd3_batch');
h_summary_a1.defineDone();
declare hash h_summary_a2(dataset: "&incas.._MOVE_MIN&mov_minutes1._TR(rename=(name=_name_ ))");
h_summary_a2.defineKey('batch_id', '_name_', 'datetime');
h_summary_a2.defineData("movave&mov_minutes1.", "movstd&mov_minutes1.");
h_summary_a2.defineDone();
declare hash h_ndist_a2(dataset: "&&incas.._MOVE_MIN&mov_minutes2._TR(rename=(name=_name_ ))");
h_ndist_a2.defineKey('batch_id', '_name_', 'datetime');
h_ndist_a2.defineData("movave&mov_minutes2.", "movstd&mov_minutes2.");
h_ndist_a2.defineDone();
end;
call missing(of _all_);
set CASUSER.TESTER1;
/* lookup */
_rc = h_summary_a1.find();
_rc = h_summary_a2.find();
_rc = h_ndist_a2.find();
run;
86 data PUBLIC.X_TEST1(drop=_rc copies=0 replace=yes );
87 if _N_ = 1 then do;
88 /* create variables */
89 if 0 then
90 do;
91 set
92 CASUSER.TESTER1
93 PUBLIC._MOVE_BATCH3_TR(keep=name BATCH_ID movave3_batch movstd3_batch rename=(name=_name_ ))
94 PUBLIC._MOVE_MIN10_TR (keep=name movave10 movstd10 BATCH_ID datetime rename=(name=_name_ ))
95 PUBLIC._MOVE_MIN30_TR (keep=name movave30 movstd30 BATCH_ID datetime rename=(name=_name_ ))
96 ;
97 end;
98 /* define hash tables */
99 declare hash h_summary_a1(dataset: "&incas.._MOVE_BATCH3_TR(rename=(name=_name_ ))");
SYMBOLGEN: Macro variable INCAS resolves to public
100 h_summary_a1.defineKey('batch_id', '_name_');
101 h_summary_a1.defineData('movave3_batch', 'movstd3_batch');
102 h_summary_a1.defineDone();
103
104 declare hash h_summary_a2(dataset: "&incas.._MOVE_MIN&mov_minutes1._TR(rename=(name=_name_ ))");
SYMBOLGEN: Macro variable INCAS resolves to public
SYMBOLGEN: Macro variable MOV_MINUTES1 resolves to 10
105 h_summary_a2.defineKey('batch_id', '_name_', 'datetime');
106 h_summary_a2.defineData("movave&mov_minutes1.", "movstd&mov_minutes1.");
SYMBOLGEN: Macro variable MOV_MINUTES1 resolves to 10
SYMBOLGEN: Macro variable MOV_MINUTES1 resolves to 10
107 h_summary_a2.defineDone();
108
109 declare hash h_ndist_a2(dataset: "&&incas.._MOVE_MIN&mov_minutes2._TR(rename=(name=_name_ ))");
SYMBOLGEN: && resolves to &.
SYMBOLGEN: Macro variable INCAS resolves to public
SYMBOLGEN: Macro variable MOV_MINUTES2 resolves to 30
110 h_ndist_a2.defineKey('batch_id', '_name_', 'datetime');
111 h_ndist_a2.defineData("movave&mov_minutes2.", "movstd&mov_minutes2.");
SYMBOLGEN: Macro variable MOV_MINUTES2 resolves to 30
SYMBOLGEN: Macro variable MOV_MINUTES2 resolves to 30
112 h_ndist_a2.defineDone();
113
114 end;
115 call missing(of _all_);
116
117 set CASUSER.TESTER1;
118
119 /* lookup */
120 _rc = h_summary_a1.find();
121 _rc = h_summary_a2.find();
122 _rc = h_ndist_a2.find();
123
124 run;
NOTE: Running DATA step in Cloud Analytic Services.
NOTE: The DATA step will run in multiple threads.
ERROR: The action stopped due to errors.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: DATA statement used (Total process time):
real time 0.36 seconds
cpu time 0.06 seconds
SYMBOLGEN: Macro variable GRAPHTERM resolves to goptions noaccessible;
125
126 /* region: Generated postamble */
127 /* Close ODS destinations */
128 &graphterm; ;*';*";*/;run;quit;
129 quit;run;
130 ods html5 (id=web) close;
131 ods listing close;
132 %if %sysfunc(fileref(_gsfname)) lt 0 %then %do;
133 filename _gsfname clear;
NOTE: Fileref _GSFNAME has been deassigned.
134 %end;
135 %studio_capture_custom_output;
MLOGIC(STUDIO_CAPTURE_CUSTOM_OUTPUT): Beginning execution.
SYMBOLGEN: Macro variable _DATAOUT_NAME resolves to
SYMBOLGEN: Macro variable _DATAOUT_MIME_TYPE resolves to
MLOGIC(STUDIO_CAPTURE_CUSTOM_OUTPUT): %IF condition "&_dataout_name" ne "" and "&_dataout_mime_type" ne "" is FALSE
MLOGIC(STUDIO_CAPTURE_CUSTOM_OUTPUT): Ending execution.
136 /* endregion */
137
... View more

0
6
Hi Team , I am not getting flag correctly Below is data USUBJID PARAMCD ADTM ADY AVISITN REPNUM 3001 EG 11JAN2024:12:12:37 29 7 1 3001 EG 11JAN2024:12:13:30 29 7 2 3001 EG 11JAN2024:12:14:07 29 7 3 3001 EG 11JAN2024:14:02:35 29 7 1 3001 EG 11JAN2024:14:03:12 29 7 2 3001 EG 11JAN2024:14:03:50 29 7 3 3002 EG 25JAN2023:14:02:22 169 7 1 3002 EG 25JAN2023:14:05:28 169 7 2 3002 EG 25JAN2023:14:08:28 169 7 3 3002 EG 01FEB2023:13:55:43 176 7 1 3002 EG 01FEB2023:13:58:46 176 7 2 3002 EG 01FEB2023:14:01:47 176 7 3 In Above i have sorted the data by USUBJID PARAMCD AVISITN ADTM REPNUM. I am try to flag minmum ADY three sets of (REPNUM) in same AVISITN , if same ADY for Two sets of REPNUM in same AVISITN then Flag Last three records by ADY value . Below is expecting want new_falg USUBJID PARAMCD ADTM ADY AVISITN REPNUM NEW_FLAG 3001 EG 11JAN2024:12:12:37 29 7 1 3001 EG 11JAN2024:12:13:30 29 7 2 3001 EG 11JAN2024:12:14:07 29 7 3 3001 EG 11JAN2024:14:02:35 29 7 1 Y 3001 EG 11JAN2024:14:03:12 29 7 2 Y 3001 EG 11JAN2024:14:03:50 29 7 3 Y 3002 EG 25JAN2023:14:02:22 169 7 1 Y 3002 EG 25JAN2023:14:05:28 169 7 2 Y 3002 EG 25JAN2023:14:08:28 169 7 3 Y 3002 EG 01FEB2023:13:55:43 176 7 1 3002 EG 01FEB2023:13:58:46 176 7 2 3002 EG 01FEB2023:14:01:47 176 7 3 in Above first subject 3001 have same ADY for first 6 records , but need flag second set of REPNUM records For second subject 3002 have different ADY for two sets for REPNUM , so will flag minimum ADY that is ADY = 169 records will flag. Thank you, Raja.
... View more

0
6
Opportunity for Improvement:
1) Add Proc Sort instructions as part of the instructions. Just to keep in consistency with the previous Practices/Assignment/Challenges OR add "When sorting the data, keep only the Region, ParkName, State, and GrossAcres columns." higher up on the list of instructions, instead of after "Write a DATA step..."
2)
Include as an alternative solution for Question 2.
proc freq data=singlestate; run;
Include as an alternative solution for Question 3.
proc print data=multistate; Where upcase(ParkName)= 'HOVENWEEP NM'; run;
... View more

0
1
Unanswered topics
These topics from the past 30 days have no replies. Can you help?