BookmarkSubscribeRSS Feed
vimal
SAS Employee
Hi all

I am creating a report where i am giving drill down for links means if i click on one link,the next will report open and inside that if i click on link another report will open and so on. The problem i am facing is that when i am exporting the various link reports to server my code is not getting stopped. I have to check manually, if the code has fully run or not and then i have to stop it. And in the task status it shows as 'Collecting' . everywhere i have given ods html close and quit wherever necesary. So please let me know if there can be a solution for this, so that my code can get automatically stopped after finishing...




Thanks in advance.....
8 REPLIES 8
syam_india_kochi
Calcite | Level 5
Hi Vimal,

To suggest a solution please put your code also here..Or else the suggestions would be all just a guess..

Please paste your entire code..

You can use the value of SYSERR as a condition to determine further action to take or to decide which parts of a SAS program to execute.

SYSERR can contain the following values:

Value Description
0 Execution completed successfully and without warning messages.
1 Execution was canceled by a user with a RUN CANCEL statement.
2 Execution was canceled by a user with an ATTN or BREAK command.
3 An error in a program run in batch or non-interactive mode caused SAS to enter syntax-check mode.
4 Execution completed successfully but with warning messages.
>4 An error occurred. The value returned is procedure dependent.

Thanks..
vimal
SAS Employee
Hi Syam

Already i have shown you the code on my system....

Reagrds Shanker,

And i can paste the code here but it is not getting properly pasted. It will be difficult to read.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
To the OP: you will get most benefit from this group by posting your SAS-generated log with all code revealed. Suggest you COPY and PASTE your log into a forum post-reply here. At this point, and from what I can see, the forum readers have not seen your code. And suggest if you have unusual characters to use in your code, read this helpful post with guidelines:

http://support.sas.com/forums/thread.jspa?messageID=27609


Scott Barry
SBBWorks, Inc.
vimal
SAS Employee
Please find this code
/****************************************/
PROC SQL ;
SELECT COUNT( distinct(cbmID) ) INTO : cbm_cnt FROM pb_level ;
RUN;

%LET cbm_cnt=%SYSFUNC(COMPRESS(&cbm_cnt));


PROC SQL ;
SELECT DISTINCT cbmID, 'cbm Email'n ,'cbm Name'n
INTO : cbmid_1-:cbmid_&cbm_cnt.,
: cbmemail_1 -: cbmemail_&cbm_cnt.,
: cbmname_1 -: cbmname_&cbm_cnt.
FROM pb_level ;
RUN;


%MACRO pb_level_rep();

%DO I=1 %TO %EVAL(&cbm_cnt.) %BY 1;

%LET cbmid = %sysfunc(compress(&&cbmid_&I..));


ods html body = "/sas/sasebi/apache/htdocs/BIU/Automation/PRIVELEGE_BANKERS/&cbmid..html" style = normal;

title j=left bold font = zurichbt color = darkblue "CBM NAME - &&cbmname_&I..";



proc report data = pb_level style(report) = [just =left font = (zurich,11pt)] split= "*"
style(header)=[BACKGROUND =maroon bordercolor =balck foreground = white FONT=(zurich, 11PT) font_weight = bold]
style(column)=[background = white FONT=(zurich, 10PT)];
where cbmid = "&cbmid";
column 'pb Name'n ("Target FY11" FY_target)
("YTD" ytd_target ytd_ach per_ach_ytd)
("MTD" mtd_target mtd_ach per_ach_mtd pbs avg_pbs)
("POINTS EARNED(MTD)"
'SB Accounts'n 'Current Accounts'n 'Fixed Deposits'n 'Fee Products'n
'GENERAL INSURANCE'n GOLD 'LIFE INSURANCE'n 'Savings Account Upgrades'n 'Current Account Upgrades'n
'AUTO LOAN'n 'HOME LOAN'n LAG PL LAP LAS 'Asset/ Agri Products'n );
DEFINE 'pb Name'n/"PB Name" style(column) = [font_weight = bold] order = data;
DEFINE FY_target/"Target" analysis format = comma10.;
DEFINE ytd_target/"EPS Target" analysis format = comma10.;
DEFINE ytd_ach/"EPS Achv." analysis format = comma10.;
DEFINE per_ach_ytd/"% Achv." COMPUTED format = percent10.2;
DEFINE mtd_target/"EPS Target" analysis format = comma10.;
DEFINE mtd_ach/"EPS Achv." analysis format = comma10.;
DEFINE per_ach_mtd/"% Achv." COMPUTED format = percent10.2;
define 'SB Accounts'n/ "SB Accounts (units)" format = 10.;
define 'Current Accounts'n/ "Current Accounts (units)" format = 10.;
define 'Current Account Upgrades'n / "Current Account Upgrades (units)" format = 10.;
define 'Savings Account Upgrades'n / "Savings Account Upgrades (units)" format = 10.;
define 'Fixed Deposits'n/ "Fixed Deposits (In Rs)" format = comma20.;
define 'Fee Products'n/ "Fee Products (In Rs)" format = comma20.;
define 'GENERAL INSURANCE'n/ "General Insurance (In Rs)" format = comma20.;
define GOLD/ "GOLD (In Rs)" format = comma20.;
define 'LIFE INSURANCE'n/ "Life insurance (In Rs)" format = comma20.;
define 'AUTO LOAN'n/ "Auto Loan (In Rs)" format = comma20.;
define 'HOME LOAN'n/ "Home Loan (In Rs)" format = comma20.;
define LAG/ "LAG (In Rs)" format = comma20.;
define PL/ "PL (In Rs)" format = comma20.;
define LAP/ "LAP (In Rs)" format = comma20.;
define LAS/ "LAS (In Rs)" format = comma20.;
define 'Asset/ Agri Products'n/ "Others (In Rs)" format = comma20.;
define pbs/ 'No. of PBs' analysis;
define avg_pbs/ "Avg. EPS/PB" computed format = comma10.;
rbreak after/summarize;
compute per_ach_ytd;
per_ach_ytd = ytd_ach.sum/ytd_target.sum;
endcomp;
compute per_ach_mtd;
per_ach_mtd = mtd_ach.sum/mtd_target.sum;
endcomp;
compute avg_pbs;
avg_pbs = mtd_ach.sum/pbs.sum;
endcomp;
compute 'pb Name'n;
if _break_ = "_RBREAK_" then do;
call define(_row_,"style","style=[background =LIGHTGREY FOREGROUND =BLACK font_WEIGHT=BOLD]");
'pb Name'n = 'Total';
end;
ENDCOMP;
quit;
ods html close;

%end;
%mend pb_level_rep();
%pb_level_rep;
Cynthia_sas
SAS Super FREQ
Hi:
This link:
http://support.sas.com/forums/thread.jspa?messageID=27609

previously posted, describes how to post code and use the [pre] and [/pre] tags around your code and output in order to maintain indenting and spacing. (and to ensure that the posted code is readable).

In addition, more descriptive info about the machine and environment where the problem is occuring would be useful...what version of SAS, what type of environment (batch submission, interactive submission, using SAS Enterprise Guide), etc, etc. -

Also useful would be to post your SAS log that shows any error messages (following the forum posting guidelines).

cynthia
vimal
SAS Employee
[pre]

PROC SQL ;
SELECT COUNT( distinct(rHID) ) INTO : rh_cnt FROM cbm_level ;
RUN;

%LET rh_cnt=%SYSFUNC(COMPRESS(&rh_cnt));


PROC SQL ;
SELECT DISTINCT rHID, 'rH Email'n ,'rH Name'n
INTO : rhid_1-:rhid_&rh_cnt.,
: rhemail_1 -: rhemail_&rh_cnt.,
: rhname_1 -: rhname_&rh_cnt.
FROM cbm_level ;
RUN;


%MACRO cbm_level_rep();

%DO I=1 %TO %EVAL(&rh_cnt.) %BY 1;

%LET rhid = %sysfunc(compress(&&rhid_&I..));


ods html body = "/sas/sasebi/apache/htdocs/BIU/Automation/PRIVELEGE_BANKERS/&rhid..html" style = normal;
title j=left bold font = zurichbt color = darkblue "RH NAME - &&rhname_&I..";
title2;
footnote ;

proc report data = cbm_level style(report) = [just =left font = (zurich,11pt)] split= "*"
style(header)=[BACKGROUND =maroon bordercolor =balck foreground = white FONT=(zurich, 11PT) font_weight = bold]
style(column)=[background = white FONT=(zurich, 10PT)];
where rhid = "&rhid";
column cbmid 'cbm Name'n ("Target FY11" FY_target)
("YTD" ytd_target ytd_ach per_ach_ytd)
("MTD" mtd_target mtd_ach per_ach_mtd pbs avg_pbs)
("POINTS EARNED(MTD)"
'SB Accounts'n 'Current Accounts'n 'Fixed Deposits'n 'Fee Products'n
'GENERAL INSURANCE'n GOLD 'LIFE INSURANCE'n 'Savings Account Upgrades'n 'Current Account Upgrades'n
'AUTO LOAN'n 'HOME LOAN'n LAG PL LAP LAS 'Asset/ Agri Products'n );
define cbmid/noprint order = data;
DEFINE 'cbm Name'n/"CBM Name" style(column) = [font_weight = bold];
DEFINE FY_target/"Target" analysis format = comma10.;
DEFINE ytd_target/"EPS Target" analysis format = comma10.;
DEFINE ytd_ach/"EPS Achv." analysis format = comma10.;
DEFINE per_ach_ytd/"% Achv." COMPUTED format = percent10.2;
DEFINE mtd_target/"EPS Target" analysis format = comma10.;
DEFINE mtd_ach/"EPS Achv." analysis format = comma10.;
DEFINE per_ach_mtd/"% Achv." COMPUTED format = percent10.2;
define 'SB Accounts'n/ "SB Accounts (units)" format = 10.;
define 'Current Accounts'n/ "Current Accounts (units)" format = 10.;
define 'Current Account Upgrades'n / "Current Account Upgrades (units)" format = 10.;
define 'Savings Account Upgrades'n / "Savings Account Upgrades (units)" format = 10.;
define 'Fixed Deposits'n/ "Fixed Deposits (In Rs)" format = comma20.;
define 'Fee Products'n/ "Fee Products (In Rs)" format = comma20.;
define 'GENERAL INSURANCE'n/ "General Insurance (In Rs)" format = comma20.;
define GOLD/ "GOLD (In Rs)" format = comma20.;
define 'LIFE INSURANCE'n/ "Life insurance (In Rs)" format = comma20.;
define 'AUTO LOAN'n/ "Auto Loan (In Rs)" format = comma20.;
define 'HOME LOAN'n/ "Home Loan (In Rs)" format = comma20.;
define LAG/ "LAG (In Rs)" format = comma20.;
define PL/ "PL (In Rs)" format = comma20.;
define LAP/ "LAP (In Rs)" format = comma20.;
define LAS/ "LAS (In Rs)" format = comma20.;
define 'Asset/ Agri Products'n/ "Others (In Rs)" format = comma20.;
define pbs/'No. of PBs' analysis;
define avg_pbs/ "Avg. EPS/PB" computed format = comma10.;
rbreak after/summarize;
compute per_ach_ytd;
per_ach_ytd = ytd_ach.sum/ytd_target.sum;
endcomp;
compute per_ach_mtd;
per_ach_mtd = mtd_ach.sum/mtd_target.sum;
endcomp;
compute avg_pbs;
avg_pbs = mtd_ach.sum/pbs.sum;
endcomp;
compute 'cbm Name'n;
if _break_ = "_RBREAK_" then do;
call define(_row_,"style","style=[background =LIGHTGREY FOREGROUND =BLACK font_WEIGHT=BOLD]");
'cbm Name'n = 'Total';
end;
%DO s = 1 %to &cbm_cnt.;
IF cbmID = "&&cbmid_&s.." then do;

call define (_col_ ,"url","http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&&cbmid_&s...html");
end;
%end;
ENDCOMP;
quit;
title j=left font = zurichbt bold "http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.percent.html>Click here for % PB Achievement";
title2 j= left font = zurichbt bold "http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.ranksheet.xls>Click here for PB RANKING";
title3 j= left font = zurichbt bold "http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.zeromtdranksheet.xls>Click here for Zero Achieved MTD";
title4 j= left font = zurichbt bold "http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.zeroytdranksheet.xls>Click here for Zero Achieved YTD";
title5 j= left font = zurichbt bold "http://sasebi/BIU/Automation/PRIVELEGE_BANKERS/&rhid.exception.xls>Click here for exception report";
proc report data = tse style(report) = [background = white bordercolor = white foreground = white borderwidth = 0] style(header) = [ bordercolor = white background = white foreground = white] style(column) = [ bordercolor = white background = white];
footnote;
quit;
ods html close;

%end;
%mend cbm_level_rep();
%cbm_level_rep;
[/pre]
vimal
SAS Employee
Thanks Cynthia And Scott

I have pasted my code.. and i am using sas eg 4.. and in log i am not getting error.
In this code i am exporting many HTML files to server. Because in my next report i have to give all these reports as a hyperlink. In this code as well i am giving hyperlinks to one column.
Cynthia_sas
SAS Super FREQ
Hi:
OK, now that we can see the code, let's revisit your original question:

The problem i am facing is that when i am exporting the various link reports to server my code is not getting stopped. I have to check manually, if the code has fully run or not and then i have to stop it. And in the task status it shows as 'Collecting' . everywhere i have given ods html close and quit wherever necesary. So please let me know if there can be a solution for this, so that my code can get automatically stopped after finishing...



So technically, ODS HTML is writing each HTML file to the physical location determined by the resolution of the macro variables in the ODS HTML statement:
[pre]
ods html body = "/sas/sasebi/apache/htdocs/BIU/Automation/PRIVELEGE_BANKERS/&rhid..html" style = normal;

[/pre]

When you say that the "code is not stopped" I don't understand what you mean. SAS is executing on a server. Is this the same server where you're writing your HTML files??? Or a different server??? Are you writing to a web server machine? Could there be some network issue between the 2 servers? Could there be timeout issues involved in writing to the server location?? Could the web guys have locked down the apache/htdocs location???

Since you say you are using SAS Enterprise Guide, are you running EG in a "standalone" EG/SAS Server environment or are you running EG within the context of the SAS Platform for Business Analytics??? Are you going to try to email these result files to the users??? I ask because I see that you are using something to do with Email in your query and creation of macro variables.

Honestly, I don't understand what you mean when you say that the "code is not stopped" or that "task status shows as 'Collecting' ." I don't think the problem is having an ODS HTML CLOSE; In your earlier, somewhat jumbled post, I saw this reference to &CBM_CNT:
[pre]
%LET cbm_cnt=%SYSFUNC(COMPRESS(&cbm_cnt));
[/pre]

And I note that you still use &CBM_CNT in the PROC REPORT step in this newly posted code, but I don't see a %LET statement for &CBM_CNT in the code you just posted. Currently, I only see
[pre]
%LET rh_cnt=%SYSFUNC(COMPRESS(&rh_cnt));

[/pre]

How does &CBM_CNT (for PROC REPORT) get assigned a value???? Are you sure that your macro program is error free and produces the desired results??

Your best bet for help with this problem might be to open a track with Tech Support -- they can look at your code and try to replicate your "code not stopping" issue using the appropriate install configuration (EG/SAS Server or EG/BI Platform & Servers).

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 8 replies
  • 1207 views
  • 0 likes
  • 4 in conversation