11-08-2024
dcortell
Pyrite | Level 9
Member since
02-02-2016
- 139 Posts
- 19 Likes Given
- 9 Solutions
- 4 Likes Received
-
Latest posts by dcortell
Subject Views Posted 1255 10-16-2024 03:48 AM 1440 10-15-2024 03:33 PM 1467 10-15-2024 03:06 PM 1489 10-15-2024 02:44 PM 1488 10-15-2024 02:42 PM 1535 10-15-2024 01:16 PM 1555 10-15-2024 12:43 PM 924 01-25-2024 12:20 PM 2693 12-04-2023 05:57 AM 2706 12-04-2023 05:11 AM -
Activity Feed for dcortell
- Posted Re: proc logistic generate "0" coefficent estimates for categorical covariate on Statistical Procedures. 10-16-2024 03:48 AM
- Posted Re: proc logistic generate "0" coefficent estimates for categorical covariate on Statistical Procedures. 10-15-2024 03:33 PM
- Posted Re: proc logistic generate "0" coefficent estimates for categorical covariate on Statistical Procedures. 10-15-2024 03:06 PM
- Posted Re: proc logistic generate "0" coefficent estimates for categorical covariate on Statistical Procedures. 10-15-2024 02:44 PM
- Posted Re: proc logistic generate "0" coefficent estimates for categorical covariate on Statistical Procedures. 10-15-2024 02:42 PM
- Posted Re: proc logistic generate "0" coefficent estimates for categorical covariate on Statistical Procedures. 10-15-2024 01:16 PM
- Posted proc logistic generate "0" coefficent estimates for categorical covariate on Statistical Procedures. 10-15-2024 12:43 PM
- Liked Re: %else on multiple %ifs statements for Astounding. 01-26-2024 04:45 AM
- Posted %else on multiple %ifs statements on SAS Programming. 01-25-2024 12:20 PM
- Posted Re: data step in cas slow processing on SAS Programming. 12-04-2023 05:57 AM
- Posted Re: data step in cas slow processing on SAS Programming. 12-04-2023 05:11 AM
- Posted Re: data step in cas slow processing on SAS Programming. 12-03-2023 07:39 AM
- Posted Re: data step in cas slow processing on SAS Programming. 12-03-2023 07:34 AM
- Posted data step in cas slow processing on SAS Programming. 12-02-2023 02:08 PM
- Posted Re: PROC SGPANEL ERROR ERROR: An exception has been encountered. on SAS Programming. 10-13-2023 03:33 PM
- Posted PROC SGPANEL ERROR ERROR: An exception has been encountered. on SAS Programming. 10-13-2023 12:39 PM
- Liked Re: ERROR: Resource is write-locked by another thread for ballardw. 09-25-2023 01:32 PM
- Posted Re: ERROR: Resource is write-locked by another thread on SAS Programming. 09-20-2023 05:36 AM
- Posted ERROR: Resource is write-locked by another thread on SAS Programming. 09-04-2023 12:56 PM
- Liked Re: Ignore macro function into a string for Quentin. 08-01-2023 08:35 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 4 1 1 -
My Liked Posts
Subject Likes Posted 2 06-08-2023 11:00 AM 1 02-03-2022 10:04 AM 1 01-19-2022 01:03 PM
06-09-2023
01:29 PM
Tom your code seems indeed breaking lines longer than 32767 bytes into multiple lines, so terrific. I'm trying to understand the logic of the code: - row it's just a counter getting +1 at each inputline iteration - col is a second counter which get a +1 whenever the limit if 32767byte is reached and the html input line is broken into more than one line - The @ prevent the input statement to release the current input record and reading the next into the buffer So for my understanding: it is the "@" that avoid to lose the remaining part of the line, exceeding the 32767 byte limit, and force the pointer to store them in a second sas dataset line?
... View more
06-09-2023
12:10 PM
To add more info, this is the part in the log where it says that few lines were truncated: 101 data rep;
102 infile src _infile_=line length=len lrecl=32767;
103 input line $varying32767. len;
104 line = strip(line);
105 if len>0;
106 run;
NOTE: La compresión del conjunto de datos WORK.REP está deshabilitada porque aumentaría el tamaño del conjunto de datos.
NOTE: The infile SRC is:
Nombre archivo=/sastmp/SAS_workC18B0001C28C_miseiddvp1/#LN00060,
Nombre de propietario=spndac,
Nombre del grupo=europe,
Permiso de acceso=-rw-rw-r--,
Última modificación=09 de junio de 2023 18H09,
Tamaño de archivo (bytes)=842654
NOTE: 32 records were read from the infile SRC.
The minimum record length was 0.
The maximum record length was 32767.
One or more lines were truncated.
... View more
06-09-2023
08:10 AM
Hi experts I'm trying to extract specific components from an HTML page with the following code: filename src temp;
proc http
url=&url
out=src;
run;
data _null_;
infile src;
input;
list;
run;
data rep;
infile src length=len lrecl=30000000;
input line $varying32767. len;
line = strip(line);
if len>0;
run; The problem I face is that the part of the HTML page I need is beyond the 32767. character limit of the varying format, so it's probably left out by SAS when reading the input line There is a way for large HTML bodies to: a. break the HTML body in lines < of te 32767 limit? I'm testing the code on this url: - https://www.youtube.com/c/sasusers/featured And I want to isolate the line which include this HTML line of text: 'metadata":{"channelMetadataRenderer":{'
... View more
06-08-2023
11:00 AM
2 Likes
In addition to Chris test, If I cut the url at the ".html" part and provide it, the scrape works fine:
%let url='https://www.sas.com/en/whitepapers/artificial-intelligence-banking-risk-management-110277.br.html';
filename src temp;
proc http
url=&url
out=src;
run;
data _null_;
infile src;
input;
list;
run;
I believe then it could make sense just to make similar URLs being trimmed at the ".HTML" part, if that allow the scraping, but still not sure why for some folks the full URL scrape works fine while on mine no
... View more
06-08-2023
09:53 AM
EDIT: Runned for a second iteration, the code works fine and no error is generated
... View more
06-08-2023
09:50 AM
Running the test code getting the following error: 92 /* Tell SAS to parse the JSON response */ 93 libname stream JSON fileref=resp; NOTE: JSON data is only read once. To read the JSON again, reassign the JSON LIBNAME. ERROR: JSON no válido en input cerca de la línea 1 columna 1: Encountered an illegal character. ERROR: Error in the LIBNAME statement. 94 95 title "JSON library structure"; 96 proc datasets lib=stream; ERROR: Libref STREAM is not assigned. 97 quit;
... View more
06-08-2023
07:43 AM
Hi experts. I'm using the following example: filename src temp;
proc http
url="https://www.sas.com/en/whitepapers/artificial-intelligence-banking-risk-management-110277.br.html#formsuccess?utm_source=linkedin&utm_medium=paid-social&utm_campaign=rsk-gen-emea&utm_content=50931-lklgf-english"
out=src;
run;
The scraping produce the following note: 73 filename src temp;
74 proc http
75 method="get"
76 url="https://www.sas.com/en/whitepapers/artificial-intelligence-banking-risk-management-110277.br.html#formsuccess?utm_so
76 ! urce=linkedin&utm_medium=paid-social&utm_campaign=rsk-gen-emea&utm_content=50931-lklgf-english"
WARNING: Apparent symbolic reference UTM_MEDIUM not resolved.
WARNING: Apparent symbolic reference UTM_CAMPAIGN not resolved.
WARNING: Apparent symbolic reference UTM_CONTENT not resolved.
77 out=src;
78 run;
NOTE: 404 Not Found
NOTE: PROCEDURE HTTP ha utilizado (Tiempo de proceso total):
real time 0.11 seconds
cpu time However, the URL is reachable and it has an HTML structure that should be possible to scrape Any idea about why the scraping is failing here?
... View more
05-08-2023
07:24 AM
I had to investigate more the pct statements but the following adjustments provided the proper % allocation in the table: data targets ;
infile datalines delimiter=',';
input quadrant account_industry cy_impact sale_amount_usm status_class ;
datalines;
1, 11, 0, 11, 11
1, 11, 1, 22, 111
2, 22, 0, 22, 22
2, 22, 1, 33, 222
2, 22, 2, 22, 222
;
run;
proc tabulate data=targets format=comma12.2
missing;
class
quadrant
account_industry
cy_impact
status_class ;
var sale_amount_usm;
table (quadrant)*account_industry*(cy_impact all='Grand Total' ),
(status_class all='Grand Total')*sale_amount_usm *
(sum="Total"*{style={background=pipe_vol.}}
pctsum<
cy_impact*sale_amount_usm
cy_impact*all
all
>)/rts=50
;
run;
... View more
05-08-2023
06:29 AM
Hi experts i'm trying to get, at column level, the % represented by each cell, for each sub-group. code like this: proc tabulate data=active_opp (where=(active_pipeline_&yy=1
and opp_class_cy="new_pipe" and quadrant in ("A"))) format=comma12.2
missing;
class
quadrant
account_industry
cy_impact
status_class ;
var sale_amount_usm;
table (quadrant)*account_industry*(cy_impact all='Grand Total' ),
(status_class all='Grand Total')*sale_amount_usm*
(sum="Total"*{style={background=pipe_vol.}}
pctn<cy_impact*sale_amount_usm
cy_impact*status_class
cy_impact*all
all
>)/rts=50
;
run; However, the % at column levels do not reflect the proper percentage values, like below Example: in column "open" the row "sourced" should be 76% but instead show a 56%. Any idea what I'm missing in the code? Bests
... View more
04-26-2023
08:25 AM
I add that If I just remove the median function from the code, the error disappear and the code works , which is weird cause the median function is listed as available function for fedsql https://go.documentation.sas.com/doc/en/pgmsascdc/v_038/fedsqlref/n12fyogjg75fznn1dk3worxdalfs.htm median(precisions) as median_precision
... View more
04-26-2023
08:00 AM
Hi people The below is causing this error: ERROR: Column "AAAA.PRECISIONS" must be GROUPed or used in an aggregate function ERROR: The action stopped due to errors. ERROR: The FedSQL action was not successful. No idea what is generating the error in the final aggreagation, as all the sub-queries work fine (tested) proc fedsql sessref=casauto;
create table casuser.test as
select
mean(precisions) as mean_precision,
median(precisions) as median_precision
from
(
select
aaa.person_id,
count(distinct(aaa.gms_deliverable_id))/5 as precisions
from
(
select
a.person_id,
b.gms_deliverable_id
from
user_recc_open a
left join
recc_test_open b
on a.person_id=b.person_id
and inputn(a.gms_deliverable_id,'best.')=b.gms_deliverable_id
) aaa
group by aaa.person_id
) aaaa
;
quit;
... View more
04-25-2023
11:22 AM
Solved with the following syntax adjustment: action aStore.score / table={caslib='Global', name='recc_test_open_dist'}, out={name='user_recc_open'}, rstore={caslib='Global Marketing (DNFS)', name='recc_dtos_astore'}, options={{name='nTopRecoms', value=&n_recc}};
... View more