07-03-2023
devrant
Obsidian | Level 7
Member since
03-20-2017
- 15 Posts
- 3 Likes Given
- 0 Solutions
- 3 Likes Received
-
Latest posts by devrant
Subject Views Posted 5328 06-13-2023 10:05 AM 5421 05-24-2023 08:23 AM 5644 05-16-2023 11:14 AM 5675 05-16-2023 10:17 AM 2260 08-25-2021 02:48 AM 2288 08-13-2021 09:52 AM 2494 08-11-2021 05:25 AM 6961 02-08-2018 09:27 AM 10533 02-07-2018 06:08 AM 2121 09-05-2017 06:47 AM -
Activity Feed for devrant
- Posted Re: Read SAS Viya REST API logs on Developers. 06-13-2023 10:05 AM
- Posted Re: Read SAS Viya REST API logs on Developers. 05-24-2023 08:23 AM
- Posted Re: Read SAS Viya REST API logs on Developers. 05-16-2023 11:14 AM
- Posted Read SAS Viya REST API logs on Developers. 05-16-2023 10:17 AM
- Got a Like for Re: SASJobExecution Logs. 08-25-2021 04:14 AM
- Posted Re: SASJobExecution Logs on SAS Viya. 08-25-2021 02:48 AM
- Got a Like for Re: SASJobExecution Logs. 08-13-2021 10:11 AM
- Posted Re: SASJobExecution Logs on SAS Viya. 08-13-2021 09:52 AM
- Tagged Re: SASJobExecution Logs on SAS Viya. 08-13-2021 09:52 AM
- Posted SASJobExecution Logs on SAS Viya. 08-11-2021 05:25 AM
- Liked Re: How can I import XML file into SAS? for Ksharp. 03-08-2019 10:42 AM
- Posted Re: Number of levels in character variables on SAS Programming. 02-08-2018 09:27 AM
- Posted Re: PROC MI Warning "An effect for variable X is a linear combination of effects" for almo on Statistical Procedures. 02-07-2018 06:08 AM
- Liked Re: Excel Export on AIX for Criptic. 09-05-2017 07:56 AM
- Got a Like for Re: Excel Export on AIX. 09-05-2017 07:55 AM
- Posted Re: Excel Export on AIX on ODS and Base Reporting. 09-05-2017 06:47 AM
- Posted Re: STP ODS HTML PROC SGRENDER & _webout as landing page on Developers. 08-29-2017 10:39 AM
- Tagged STP ODS HTML PROC SGRENDER & _webout as landing page on Developers. 08-29-2017 10:34 AM
- Posted STP ODS HTML PROC SGRENDER & _webout as landing page on Developers. 08-29-2017 09:15 AM
- Tagged STP ODS HTML PROC SGRENDER & _webout as landing page on Developers. 08-29-2017 09:15 AM
-
Posts I Liked
Subject Likes Author Latest Post 4 1 3 -
My Liked Posts
Subject Likes Posted 1 08-25-2021 02:48 AM 1 08-13-2021 09:52 AM 1 09-05-2017 06:47 AM
06-13-2023
10:05 AM
Hello!
A short feedback from my side.
The request gets constructed like this:
req := utl_http.begin_request(url, 'POST'); -- works with the following too: utl_http.begin_request(url, 'POST', utl_http.http_version_1_1);
utl_http.set_header(req, 'User-Agent', 'Mozilla/4.0'); -- works without User-Agent header too
The following 3 rows seem to have made the difference:
utl_http.set_header(req, 'Accept', '*/*');
utl_http.set_header(req, 'Accept-Encoding', 'gzip, deflate, br');
utl_http.set_header(req, 'Connection', 'keep-alive');
BR
Devrant
... View more
05-24-2023
08:23 AM
Hello Joe, hello Allan, hello Alan!
First, I wanted to thank you all, for sharing you expretise.
I haven't had the time yet to thoroughly test your proposals, but I can confirm that I now recieve HTTP status codes 200 and 201. I'll need to slightly adjust my query to be able to call a job execution and I would also need to implement some wrapper functions for automated token renewal. For now I've tried to sniff my requests with Fiddler(+tcpdump) and Wireshark but to no avail.
I shall provide some updates as I've figured the reason. BR
Devrant
... View more
05-16-2023
11:14 AM
Hi @joeFurbee!
Thank you for your prompt response. Let me describe my use case in a couple of points.
Goal: I want to call a specific SAS job over the REST API from PL/SQL.
I've successfuly done so with postman and with curl, so I assume that I have the request in the form I need it.
Now I want to achieve the same thing with the same request, but using PL/SQL which apparenly does not seem to work so far. In case of other APIs my PL/SQL proc functions properly.
(I get:
"<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>400 Bad Request</title> </head><body> <h1>Bad Request</h1> <p>Your browser sent a request that this server could not understand.<br /> </p> </body></html> ")
-----
I've also installed Mockoon to locally test what is being passed on from PL/SQL to a mock API. (There my request looks as follows:
GENERAL:
Request URL: /content/xyz
Method: POST
Caught by route: /content/:param1
HEADERS:
Accept: application/vnd.sas.job.execution.job+json
Authorization : Bearer: ey...
Connection: close
Content-length: 166
Content-type: application/vnd.sas.job.execution.job.request+json
Host: xxxxx
User-agent: Mozilla/4.0
PARAMS:
Route params (1)
param1: xyz
Query params (none)
BODY:
{ "jobDefinitionUri": "/jobDefinitions/definitions/xxx", "arguments":{ "_contextName": "SAS Job Execution compute context"} })
and I get a response HTTP status 200.
---
Therefore I'm looking for a way to see what actually "arrives" to SAS, in other words, what is actually being called from the API side.
BR
Devrant
... View more
05-16-2023
10:17 AM
Hi! I'd like to know, if there is any way to access the part of a http request passed on to the said API where one can check was actually passed on (e.g. url, header(s), body). Is there any way to do that? Thanks in advance. BR Devrant
... View more
08-25-2021
02:48 AM
1 Like
Hi, I've finally figured what the issue was. I got to know, that the SASJobExecution service requires access to SASStudioV to run the SAS code part of a job definition. Although the test user had access within Viya to SASStudioV, spite the SASUSER library Studio was not able to run, thus the SAS code in the job was also not executed. I've realized that the SASUSER requires an existing home diretory on the linux filesystem. Without that SASStudioV was not able to start at all, thus the SAS code part of thejob wasn't able to run at all, therefore no job execution logs were generated. Essentially, the dependencies of a SAS job to be executed in a job definition requires the following: SASStudioV <-- SASUSER library <-- physical home directory on the Viya servers's filesystem. edit: typo
... View more
08-13-2021
09:52 AM
1 Like
Hi Jim, hi Allen, Thank you for your swift answer! I've changed the other user's rights and user groups, so that we both have all the same Viya permission settings. Unforunately it did not solve my issue so far, therefore what I'm considering now is to either ask our server admin - as Allen suggests/suggested - to provide me with the job logs or to ask him to restart the server. I'll get back to you with my findings next week. Have a nice weekend!
... View more
- Tags:
- ve
08-11-2021
05:25 AM
Hi, using the SASJobExecution\Jobs interface I can usually check out the execution logs for jobs that were called from Visual Analytics. Unfortunately I've came across a situation today, where the job execution by an other user throws an error and seemingly doesn't produce any logs. To be more specific, the same job was being called from the same VA report, however with this other user the 'show log' context menu shows an error message that the log wasn't found. When I check the job output from the same context menu for the same execution it shows the following: "Das für den Auftrag angegebene SAS-Programm stieß beim Start auf einen Fehler. The session requested is currently in a failed or stopped state.". In the Environment Manager I've fonud the following entry for the job call: "service [***] [ERROR_STARTING_JOB] Error starting compute service job *** due to exception 400 Bad Request.". Could you please guide me why I don't get any job execution logs in this case? Thank you!
... View more
02-08-2018
09:27 AM
How would you tackle a data set with more than 70k levels for at least one variable? (proc freq always yields OoM error.)
... View more
02-07-2018
06:08 AM
%Macro ExcludeVars;
%local i;
data _NULL_;
array Var{*} &Continuous ;
array Ex{*} &Exclude;
%Let _drop_= ;
do i=1 to dim(Ex);
if Ex(&i) in Var then
%Let _drop_=&_drop_ %sysfunc(scan(&Exclude,&i));
end;
%put &=_drop_;
run;
%Mend ExcludeVars;
%ExcludeVars; Notice that a local macro variable has to be created (either with let or local statements) in order to use it with the scan sysfunc call, also it has to be referenced as a macro variable to get it resolved into a numerical value, instead of a string "i".
... View more
09-05-2017
06:47 AM
1 Like
Hi, I'd check these options too: http://blogs.sas.com/content/sasdummy/2012/02/11/export-excel-methods/ Especially these: http://support.sas.com/documentation/cdl/en/acpcref/63181/HTML/default/viewer.htm#p1d0tocg3njhmfn1d4ld2covlwm0.htm http://blogs.sas.com/content/sasdummy/2012/01/25/export-to-excel-got-easier/
... View more
08-29-2017
10:39 AM
Hi @ballardw wrote: You reference a macro variable "&outp." used in the output path but do not show where or when in your code that macro variable is set. So there may be something associated with that. See 3rd code snippet for outp definition.
... View more
08-29-2017
09:15 AM
Greetings! I've encountered the following interesting phenomena: I'm generating graphs (9.04.01M4P110916) with SGRENDER and using ODS to create html drill down functionality. Everything is working fine, the images and the htmls are properly generated with the desired content, except that the first graph I generate will have the following html img src tag: <IMG class=c style="HEIGHT: 1080px; WIDTH: 1920px" border=0 alt="Die Prozedur SGRender" src="/SASStoredProcess/do?_sessionid=D5D2F237-F64E-425C-A1CB-DD538B2ABDCB&_program=replay&_entry=APSWORK.TCAT0057.curent_year.png" useMap=#curent_year> Instead of following the structure of the other generated htmls' img src tags: <IMG class=c style="HEIGHT: 1080px; WIDTH: 1920px" border=0 alt="Die Prozedur SGRender" src="\\*****\Users\***\Documents\My SAS Files\9.4\last_2_months.png" useMap=#last_2_months> The outp macro variable is: %let outp = \\******\Users\%substr(%sysfunc(dequote(&_METAUSER)),1,7)\Documents\My SAS Files\9.4; The code that I'm using to generate the htmls and the images is as follows: %macro main;
/**
START
displaying all available arbstnrs with overall completeness percentages, links are pointing to individual arbstnrs displaying incuding yearly aggregates
**/
proc template;
define statgraph basechart;
begingraph / designwidth=1280 designheight=720 subpixel=on;
layout overlay / cycleattrs = true
yaxisopts=(griddisplay=on gridattrs=(color=lightgray pattern=dot));
barchart category=arbsttext response=main_completeness_pct /
name="completeness"
group=arbstnr_dwh
groupdisplay=cluster
barwidth=0.5
clusterwidth=0.5
dataskin=crisp
url = to_url
tip = (group) barlabel = true
;
endlayout;
endgraph;
end;
run;
%macro genmain;
ods graphics / reset imagemap=on imagename="main"
antialiasmax=2000 tipmax=2000 drilltarget="_self" push show;
ods html path="&outp." file="main.html";
%let intable=main_display_all;
proc sgrender data=&intable. template=basechart;
title &intable.;
footnote 'main page';
run;
ods html close;
ods graphics / reset imagemap=off;
%mend;
%genmain;
/**
END
displaying all available arbstnrs with overall completeness percentages, links are pointing to individual arbstnrs displaying incuding yearly aggregates
**/
%mend; And: %macro mainy;
/**
START
displaying specific arbstnr with yearly completeness percentages, links are pointing to individual arbstnrs displaying monthly aggregates
**/
proc template;
define statgraph basechart;
begingraph / designwidth=1280 designheight=720 subpixel=on;
layout overlay / cycleattrs = true
yaxisopts=(griddisplay=on gridattrs=(color=lightgray pattern=dot));
barchart category=neu_year_dwh response=yearly_completeness_pct / stat = mean
name="completeness"
group=arbsttext
groupdisplay=cluster
barwidth=0.5
clusterwidth=0.5
dataskin=crisp
url = to_url
tip = (group) barlabel = true;
endlayout;
endgraph;
end;
run;
%macro genmain_yearly(arbstnr=);
ods graphics / reset imagemap=on imagename="main_&arbstnr."
antialiasmax=2000 tipmax=2000 drilltarget="_self" push show;
ods html path="&outp." file="main_&arbstnr..html";
%let intable=result_&ye.;
proc sgrender data=&intable. template=basechart;
title &intable._&arbstnr;
where arbstnr_dwh = "&arbstnr";
footnote link="&outp..\main.html" 'Back';
run;
ods html close;
ods graphics / reset imagemap=off;
%mend;
%let intable = main_display_all;
filename mainy catalog "work.main_arbst.graphs.source";
data _null_;
set &intable.;
file mainy recfm=v lrecl=1024;
put '%genmain_yearly(arbstnr=' @;
put arbstnr_dwh @;
put ');';
run;
%include mainy;
filename mainy clear;
/**
END
displaying specific arbstnr with yearly completeness percentages, links are pointing to individual arbstnrs displaying monthly aggregates
**/
%mend; To create the landing page I use the following code: %let link = \\******\Users\%substr(%sysfunc(dequote(&_METAUSER)),1,7)\Documents\My SAS Files\9.4;
%let text=Fertig.;
ods trace off;
ods _all_ close;
ods html body=_webout path=&_tmpcat
(url=&_replay);
title;
footnote;
ods html text="&text";
data landing;
length Ergebnisse $200;
Ergebnisse = "<a href=""&link"">hier</a>";
run;
proc print data= landing noobs;
title "Ergebnisse";
footnote link = 'https://*****/SASStoredProcess/do?_action=form,properties,execute,nobanner,newwindow&_program=*****' "Back";
quit;
ods html close; The STP is saved in metadata as follows: What should I change to avoid the incorrect html img src creation? Thanks in advance! EDIT - the html img src tags were having the _html in the image names, they have been removed
... View more
04-25-2017
05:17 AM
Thanks Paul! This did the trick: I've added my own account to SAS Administrators user group. Cheers!
... View more
04-25-2017
03:54 AM
Hello Paul, Yes indeed, the first part is from MC, I'm logged in as sasadm@saspw (unrestricted). The credentials were stored credentials, that I've previously added as Auth Domain for the "oracle users" user group. In SQL developer the DB is working perfectly with the same user credentials and path/schema. The library is pre-assigned as I've configred it in metadata. The second log snippet is also from MC, when I tried to register the table in the library. I was able the register all the other tables in this DB/schema without any (unexpected) problems. The LIBNAME statement generated by MC, if I remove pre-assigment is the following: LIBNAME dwh ORACLE PATH="path" SCHEMA=schema USER=user PASSWORD="secret" ; When I run (after removing pre-assignment) the above LIBNAME statement with my own user, that is a member of the previously mentioned "oracle users" user group in EG, the log is as follows: 29 LIBNAME dwh ORACLE PATH="***.world" SCHEMA=schema USER=user PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ;
NOTE: Libref DWH was successfully assigned as follows:
Engine: ORACLE
Physical Name: ***.world When I run (after removing pre-assignment) a self written LIBNAME statement with my own user in EG, the log is as follows: 29 libname dwh oracle path=***.world schema=schema user=user password=XXXXXX ;
NOTE: Libref DWH was successfully assigned as follows:
Engine: ORACLE
Physical Name: ***.world Note: I've used 2 different sessions of EG for each LIBNAME statement. Sorry, I should've probably mentioned that I used EG for the third log part. Here I've been logged with my own user, that is a member of the previously mentioned "oracle users" user group. Yes the credentials saved in metadata are the same as the ones I've supplied, because that is how I set it up (and also as the ones I use for SQL developer). Thanks!
... View more
04-24-2017
11:40 AM
Hello! I'm facing the following issue when updtating a certain table's metadata in MC:
/********************************************************************************
* Tabellennummer: 1
* Tabellenname: QW_KOSTENTRAEGER
********************************************************************************/
1 Das SAS System 17:11 Monday, April 24, 2017
NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M4 MBCS3170)
Licensed to ******.
NOTE: This session is executing on the X64_SR12R2 platform.
NOTE: Updated analytical products:
SAS/STAT 14.2
SAS/ETS 14.2
SAS/OR 14.2
SAS/QC 14.2
NOTE: Additional host information:
X64_SR12R2 WIN 6.3.9600 Server
NOTE: SAS-Initialisierung used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
NOTE: The autoexec file, D:\SAS\Config\Lev1\SASApp\WorkspaceServer\autoexec.sas, was executed at server initialization.
1
2 proc metalib;
3
4 omr (libid="B40000SI" repid="A5OV2K45");
5 report(type = summary);
6 update_rule = (noadd);
7 select (A5OV2K45.BE0001XD);
8
9 run;
ERROR: ORACLE connection error: ORA-01017: invalid username/password; logon denied.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROZEDUR METALIB used (Total process time):
real time 0.17 seconds
cpu time 0.03 seconds
10
/********************************************************************************/
When I want to register a certain table I get the following: 1 Das SAS System 17:35 Monday, April 24, 2017
NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M4 MBCS3170)
Licensed to ********.
NOTE: This session is executing on the X64_SR12R2 platform.
NOTE: Updated analytical products:
SAS/STAT 14.2
SAS/ETS 14.2
SAS/OR 14.2
SAS/QC 14.2
NOTE: Additional host information:
X64_SR12R2 WIN 6.3.9600 Server
NOTE: SAS-Initialisierung used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
NOTE: The autoexec file, D:\SAS\Config\Lev1\SASApp\WorkspaceServer\autoexec.sas, was executed at server initialization.
1 libname dwh list;
ERROR: Libref DWH ist nicht zugewiesen.
ERROR: Error in the LIBNAME statement. However if I call libname list or proc datasets it works perfectly with the same credentials: 29 libname dwh list;
NOTE: Libref= DWH
Scope= Object Server
Engine= ORACLE
Physical Name= ****.world
Schema/User= ***
30 %let lib=dwh;
31 proc datasets library=&lib;
SYMBOLGEN: Macro variable LIB resolves to dwh
32
32 ! contents data=QW_KOSTENTRAEGER;
33 quit;
NOTE: PROCEDURE DATASETS used (Total process time):
real time 6.08 seconds
user cpu time 0.12 seconds
system cpu time 0.03 seconds
memory 1912.40k
OS Memory 20728.00k
Timestamp 04/24/2017 05:30:53 PM
Step Count 6 Switch Count 2 Note: for now I don't have access to \Lev*\ folder so couldn't dig deeper. Any suggestions what could be the problem? Thanks!
... View more