Recent Activity
I am attempting to find the location of a word within a string, not the character position, but where in the string the word appears. For example, the following code: data example;
input string $50.;
word = 'word';
position = find(string, word);
datalines;
This is a sample string containing the word.
Another example without the keyword.
The word appears here.
;
run; Has the output of However, the position I am seeking is: OBS1 position 8 OBS2 position 0 OBS3 position 2 Reason being the actual data will have wildcards scattered within the string that could be replaced with any number of characters and this value will later be used in a scan function to find specific matches in a delimited variable value. Hope that makes sense...
... View more

0
2
Hello
I run this code using ODS EXCEL with now option.
I a using SAS enterprise guide 8.3.
Client version : '8.3.0.103' (When I run %put &_clientversion;)
My question- what is the reason for this error????
ods excel file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Ex12.xlsx" options(sheet_interval="none");
proc print data=sashelp.class(where=(sex="M"));
run;
proc means data=sashelp.class(where=(sex="M"));
run;
ods excel options(sheet_interval="now");
proc print data=sashelp.class(where=(sex="F"));
run;
proc means data=sashelp.class(where=(sex="F"));
run;
ods excel close;
Here is the Log where can see the errors
1 The SAS System 08:38 Wednesday, May 7, 2025
1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='ODS EXCEL_b_Best!.sas';
4 %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';
5 %LET _CLIENTPROJECTPATH='';
6 %LET _CLIENTPROJECTPATHHOST='';
7 %LET _CLIENTPROJECTNAME='';
8 %LET _SASPROGRAMFILE='M:\a.ריכוז תוכניות\Learn\ODS EXCEL_b_Best!.sas';
9 %LET _SASPROGRAMFILEHOST='HKSU102561A79';
10
11 ODS _ALL_ CLOSE;
12 OPTIONS DEV=SVG;
13 GOPTIONS XPIXELS=0 YPIXELS=0;
14 %macro HTML5AccessibleGraphSupported;
15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16 %mend;
17 FILENAME EGHTML TEMP;
18 ODS HTML5(ID=EGHTML) FILE=EGHTML
19 OPTIONS(BITMAP_MODE='INLINE')
20 %HTML5AccessibleGraphSupported
NOTE: The ACCESSIBLE_GRAPH option is pre-production for this release.
21 ENCODING='utf-8'
22 STYLE=HTMLBlue
23 NOGTITLE
24 NOGFOOTNOTE
25 GPATH=&sasworklocation
26 ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27
28 ods excel file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Ex12.xlsx" options(sheet_interval="none");
WARNING: Unsupported device 'SVG' for EXCEL destination. Using default device 'PNG'.
29 proc print data=sashelp.class(where=(sex="M"));
30 run;
NOTE: There were 10 observations read from the data set SASHELP.CLASS.
WHERE sex='M';
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.12 seconds
user cpu time 0.04 seconds
system cpu time 0.00 seconds
memory 2953.12k
OS Memory 50200.00k
Timestamp 05/09/2025 08:34:39 PM
Step Count 8508 Switch Count 0
Page Faults 0
Page Reclaims 187
Page Swaps 0
Voluntary Context Switches 13
Involuntary Context Switches 1
Block Input Operations 0
Block Output Operations 0
31 proc means data=sashelp.class(where=(sex="M"));
32 run;
NOTE: Multiple concurrent threads will be used to summarize data.
NOTE: There were 10 observations read from the data set SASHELP.CLASS.
2 The SAS System 08:38 Wednesday, May 7, 2025
WHERE sex='M';
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.04 seconds
user cpu time 0.03 seconds
system cpu time 0.01 seconds
memory 7087.29k
OS Memory 56876.00k
Timestamp 05/09/2025 08:34:39 PM
Step Count 8509 Switch Count 1
Page Faults 0
Page Reclaims 1741
Page Swaps 0
Voluntary Context Switches 36
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
1 The SAS System 20:34 Friday, May 9, 2025
ERROR: Argument now for word option sheet_interval not recognized. Expecting one of these keywords output, table, page, bygroup,
bygroups, proc, none or none.
33
34 ods excel options(sheet_interval="now");
35 proc print data=sashelp.class(where=(sex="F"));
36 run;
ERROR: In event 'output': Out of space writing to file
/usr/local/saswork/SAS_workD9C000003A20_LINX107717A13/SAS_workD57B00003A20_LINX107717A13/_T00007F31DAA2F460/xl/worksheets/she
et1.xml.
stack traceback:
[C]: in function 'error'
?: in function <?:127>
(tail call): ?
?: in function 'close'
?: in function 'close'
?: in function 'finish_worksheet'
?: in function 'start_worksheet'
?: in function '?'
?: in function <?:508>
(tail call): ?
ERROR: An error occurred during script execution. See the preceding messages.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 9 observations read from the data set SASHELP.CLASS.
WHERE sex='F';
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.02 seconds
user cpu time 0.01 seconds
system cpu time 0.00 seconds
memory 618.78k
OS Memory 51736.00k
Timestamp 05/09/2025 08:34:39 PM
Step Count 8510 Switch Count 6
Page Faults 0
Page Reclaims 18
Page Swaps 0
Voluntary Context Switches 101
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
37 proc means data=sashelp.class(where=(sex="F"));
38 run;
NOTE: Multiple concurrent threads will be used to summarize data.
ERROR: In event 'output': ?:0: attempt to index field 'sheetdata' (a nil value)
stack traceback:
?: in function 'finish_worksheet'
?: in function 'start_worksheet'
?: in function '?'
?: in function <?:508>
(tail call): ?
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 9 observations read from the data set SASHELP.CLASS.
WHERE sex='F';
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.01 seconds
user cpu time 0.01 seconds
system cpu time 0.01 seconds
memory 6580.40k
3 The SAS System 08:38 Wednesday, May 7, 2025
OS Memory 57644.00k
Timestamp 05/09/2025 08:34:40 PM
Step Count 8511 Switch Count 1
Page Faults 0
Page Reclaims 1442
Page Swaps 0
Voluntary Context Switches 34
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
ERROR: In event 'doc': ?:0: attempt to index field 'sheetdata' (a nil value)
stack traceback:
?: in function 'finish_worksheet'
?: in function '?'
?: in function <?:508>
(tail call): ?
39 ods excel close;
NOTE: Writing EXCEL file: /usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/Ex12.xlsx
40
41
42 %LET _CLIENTTASKLABEL=;
43 %LET _CLIENTPROCESSFLOWNAME=;
44 %LET _CLIENTPROJECTPATH=;
45 %LET _CLIENTPROJECTPATHHOST=;
46 %LET _CLIENTPROJECTNAME=;
47 %LET _SASPROGRAMFILE=;
48 %LET _SASPROGRAMFILEHOST=;
1 The SAS System 20:34 Friday, May 9, 2025
ERROR: Calling global tagset function 'detach_stream':
Out of space writing to file /usr/local/saswork/SAS_workD9C000003A20_LINX107717A13/#LN05564.
stack traceback:
[C]: in function 'error'
?: in function <?:127>
(tail call): ?
?: in function 'close'
?: in function 'detach'
?: in function <?:43>
49
50 ;*';*";*/;quit;run;
51 ODS _ALL_ CLOSE;
ERROR: An error occurred during script execution. See the preceding messages.
52
53
54 QUIT; RUN;
55
... View more

0
3
I have about forty jobs getting data from somewhere online (where? I don't know; online's everywhere). Most of them will pick up only a handle of incremental files each day and put them on our Linux terminal server; they then get pushed to an S3 bucket (somewhere else!), and from there read into Snowflake. As of today, it works perfectly, except for one job.
We've ironed out almost all the procedural problems, except for one. When I run the jobs through DI (I've created a bespoke transformation which takes the name of the source table and automates the whole process through to Snowflake), they all run fine. But when they've been deployed and run under the service account, the big job (which reads roughly new 11.5k files a day) always crashes. Today's run was when it attempted file 3,574.
Because the log becomes quickly unmanageable and for security reasons, I mask it by using option nomprint, but I expose where it's up to and the error messages.
From the log:
File 3,570: 07MAY2025:22:16:11 /org/warehouse/bin/gateway/edh/org_table_name/_change_data/cdc-00068-5dafcc5b-7512-4ecb-9175-91d01fb39600.c000.snappy.parquet
File 3,571: 07MAY2025:22:16:11 /org/warehouse/bin/gateway/edh/org_table_name/part-00066-c7df53d0-0747-4e30-8c39-16c9ac9d075b.c000.snappy.parquet
File 3,572: 07MAY2025:22:16:11 /org/warehouse/bin/gateway/edh/org_table_name/part-00067-e7b5f225-f351-448a-b5f9-4624b613fdc0.c000.snappy.parquet
File 3,573: 07MAY2025:22:16:11 /org/warehouse/bin/gateway/edh/org_table_name/part-00068-f00a655d-10c3-4b17-93dd-2083d213618b.c000.snappy.parquet
ERROR: tkzCapture() failed
ERROR: tkzCapture() failed
ERROR: tkzCapture() failed
ERROR: Unable to establish an SSL connection.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0b4en" is not found.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0b4en" is not found.
ERROR: Message file is not loaded.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0b4en" is not found.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0b4en" is not found.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0a2en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0a2en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0a2en" is not found.
ERROR: Message file is not loaded.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0a2en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0a2en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0a2en" is not found.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0b4en" is not found.
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Extension Load Failure: OS Error: -1 (/sso/sfw/sas/940/SASFoundation/9.4/sasexe/t0b4en.so: cannot open shared object file: Too many open files)
ERROR: Message file "t0b4en" is not found.
ERROR: Message file is not loaded.
WARNING: Apparent symbolic reference SYS_PROCHTTP_STATUS_CODE not resolved.
WARNING: Apparent symbolic reference SYS_PROCHTTP_STATUS_CODE not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was: &sys_prochttp_status_code > 200
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
I think that sys_prochttp_status_code is destroyed at the top of each http call and created again very soon after, so I suspect that the error is being picked up at the procedure initialisation.
I've checked both my and the service account's Linux ulimit values - both 350,000, so the Too many open files would appear to be a red herring.
Here's the meat of the getfiles macro:
%do i = 1 %to &files;
%let rc = %sysfunc(fetchobs(&dsid, &i));
%let file = %sysfunc(strip(&file));
%if %eval(%sysfunc(indexc(&file, %str(/)))) %then %do;
%let sub_directory = %sysfunc(scan(&file, 1, %str(/)));
%if %eval(%sysfunc(fileexist(&parent_directory/&source/&sub_directory)) = 0) %then /* Create each non-existant directory */
%let rc = %sysfunc(dcreate(&sub_directory, &parent_directory/&source));
%end;
%if %eval(%sysfunc(fileexist(&parent_directory/&source/&file)) = 1) %then /* Don't bother re-getting a file */
%goto EndLoop;
filename source "&parent_directory/&source/&file";
%let url = https://&source_url/files/download?;
%let url = &url.tableName=&source.%nrstr(&file=)&file;
%let fail_count = 0;
/*
Every (hour - 500 seconds), get another bearer code. It is only valid for an hour, so 500 seconds short
will (prob'ly) always work. If it doesn't, something else has gone wrong. This should be good for around 12-15,000 files at a time.
*/
%if %sysevalf(%sysfunc(datetime()) > "&bearer_expiry"dt) %then
%renew_bearer;
%do %until(%eval(&sys_prochttp_status_code) = 200);
proc http url="&url"
proxyhost="http://webproxy.vsp.sas.com:3128"
oauth_bearer="&bearer"
in='scope=urn://onmicrosoft.com/vcp/api/vbi/.default'
out=source
timeout=1000 /* How long to wait (seconds) */
method='get';
headers 'Accept' = 'application/json'
'consistencylevel' = 'eventual';
run;
%if %eval(&sys_prochttp_status_code > 200) %then %do;
%put %sysfunc(strip(%sysfunc(datetime(), datetime23.3))) HTTP Status code: &sys_prochttp_status_code %refnumv(val=&i) &=file;
%let fail_count = %eval(&fail_count + 1);
%if %eval(&fail_count > 5) %then %do;
%check_status
%goto EndMac;
%end;
%let rc = %sysfunc(sleep(30, 1));
%end;
%end;
%put File %refnumv(val=&i): %sysfunc(strip(%sysfunc(datetime(), datetime19.))) %sysfunc(strip(%sysfunc(putn(&lastmodified, datetime23.)))) &parent_directory/&source/&file;
filename source clear;
%EndLoop:
%end;
I could obviously check for the symbol existence of sys_prochttp_status_code before I check its contents - but its non-existence isn't something I had considered!
I'm pretty much convinced that it's something specific with the service account, but my ingestion jobs run through it literally thousands of times a day without error, including many that use proc http, and I've never seen this before.
Has anyone ever seen anything like this before? What is tkzCapture()? what are toa4en and t0b4en, and why can't they be (re-)opened? They do exist - seven years old. Maybe it's a factor of running M6; M8 may be getting installed mid-year.
... View more

0
4
I'm new to SAS (v9.4) and statistics in general. I want to do an ordinal logistic regression (N = 430 employees) . My dependent and independent variables are ordinals. Job Satisfaction (scaled from 1 -5) and Work Respect (scaled from 1 - 4). I have 35 potential covariates (confounders) and I want to come up with a reduced number of variables that are greatly de-correlated from each other before adding them to my model. These covariates are binary, ordinal, continuous, and nominal variables. I'm at a loss/unsure which SAS function(s) to use to remove / drastically reduce any co-dependencies within these variables. Will de-correlation via GVIF work for all or will CATPCA analysis be enough? The SAS functions I've looked at either work for categorical variables only (ordinals and nominals) or some combination of three out of four variable types. What do you recommend I do to eliminate collinearity amongst mixed variables? PS Grok 3 says I need to do individual de-correlation procedures suitable for each variable type. I'm hesitant to believe it for now. I am concerned that, for example, a reduced continuous variable set might correlate with reduced ordinal set, if I perform separate analyses. EDIT ... made a slight change for better clarity.
... View more

0
2
Hi, I have a new PC Windows11. I have Sas/PC on in Windows10 - 32 bit and now Sas/Pc in Windows11 - 64 bit. I have difficulties to migrate programs and catalogs of my sasuser.profile. Can you help me ?
... View more

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