Hello!
I have downloaded the job log from the Environment Manager. What format has it? How can I view it?
Cheers, Klaus
Example:
{"version":2,"name":"items","accept":"application/vnd.sas.compute.log.line","start":0,"items":[{"version":1,"type":"source","line":"1 %JESBEGIN"},{"version":1,"type":"normal","line":""},{"version":1,"type":"normal","line":">>> SAS Macro Variables:"},{"version":1,"type":"normal","line":" _ADDJESBEGINENDMACROS=true"},{"version":1,"type":"normal","line":" _APSLIST=_clientname,_csrf,_debug,_htua,_program,_rmtaddr,_rmthost,_url,_userlocale,_version,_xforward"},{"version":1,"type":"normal","line":" _CLIENTNAME=SASJobExecution"},{"version":1,"type":"normal","line":" _CONTEXTNAME=SAS Job Execution compute context"},{"version":1,"type":"normal","line":" _CSRF=9008e378-e7a6-4e5c-9cd3-90cca6f76b95"},{"version":1,"type":"normal","line":" _DEBUG=log"},{"version":1,"type":"normal","line":" _HTUA=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"},{"version":1,"type":"normal","line":" _OMITJSONLISTING=true"},{"version":1,"type":"normal","line":" _OMITJSONLOG=false"},{"version":1,"type":"normal","line":" _OMITSESSIONRESULTS=true"},{"version":1,"type":"normal","line":" _OMITTEXTLISTING=true"},{"version":1,"type":"normal","line":" _OMITTEXTLOG=true"},{"version":1,"type":"normal","line":" _PROGRAM=/TKbisy/Pilot/UC Versicherungspfade/03 Jobs/SeqJobDef"},{"version":1,"type":"normal","line":" _REPLAY=/SASJobExecution/?_jobexec=/jobExecution/jobs/5c50b76a-a741-4b9d-a5f2-587f328cd4fc&_entry="},{"version":1,"type":"normal","line":" _RMTADDR=10.252.54.142"},{"version":1,"type":"normal","line":" _RMTHOST=10.252.54.142"},{"version":1,"type":"normal","line":" _SUPPRESS_MVARS= "},{"version":1,"type":"normal","line":" _URL=/SASJobExecution/"},{"version":1,"type":"normal","line":" _USERLOCALE=de_DE"},{"version":1,"type":"normal","line":" _VARIABLEFILTER=eq(name,'_STATUS_MESSAGE')"},{"version":1,"type":"normal","line":" _VERSION=SASJobExecution Version 2.1"},{"version":1,"type":"normal","line":" _XFORWARD=sas-viya-plattform-prod.dst.tk-inline.net"},{"version":1,"type":"title","line":" The SAS System"},{"version":1,"type":"title","line":""},{"version":1,"type":"normal","line":" SYS_COMPUTE_DATA=/opt/sas/viya/config/data/compsrv/default"},{"version":1,"type":"normal","line":" SYS_COMPUTE_JOB_ID=4C52BF3D-7B4E-EC43-B040-B3245C02A510"},{"version":1,"type":"normal","line":" SYS_COMPUTE_SESSION_ID=a9f81288-23e1-4fef-b74e-754ddbf15ebb-ses0000"},{"version":1,"type":"normal","line":" SYS_COMPUTE_SESSION_OWNER=P226526"},{"version":1,"type":"normal","line":" SYS_JES_JOB_URI=/jobExecution/jobs/5c50b76a-a741-4b9d-a5f2-587f328cd4fc"},{"version":1,"type":"normal","line":"\r\n"},{"version":1,"type":"normal","line":""},{"version":1,"type":"source","line":"2 /*****************************************************************************************************"},{"version":1,"type":"source","line":"3 * Job: SeqJobDef"},{"version":1,"type":"source","line":"4 * Beschreibung: UC Kündigerpfade: Test unterschiedlicher Setting für Proc Sequence"},{"version":1,"type":"source","line":"5 * Datum: 20.05.2020"},{"version":1,"type":"source","line":"6 * Autor: Klaus Rösner"},{"version":1,"type":"source","line":"7 ******************************************************************************************************/"},{"version":1,"type":"source","line":"8 "},{"version":1,"type":"source","line":"9 /*****************************************************************************************************"},{"version":1,"type":"source","line":"10 * Änderungshistorie:"},{"version":1,"type":"source","line":"11 *"},{"version":1,"type":"source","line":"12 * Datum Autor Änderung"},{"version":1,"type":"source","line":"13 * ----------------------------------------------------------------------------------------------------"},{"version":1,"type":"source","line":"14 *"},{"version":1,"type":"source","line":"15 *"},{"version":1,"type":"source","line":"16 *"},{"version":1,"type":"source","line":"17 *"},{"version":1,"type":"source","line":"18 ******************************************************************************************************/"},{"version":1,"type":"source","line":"19 "},{"version":1,"type":"source","line":"20 *----------------------------------------------------------------------------------------------------*;"},{"version":1,"type":"source","line":"21 * Optionen setzen;"},{"version":1,"type":"source","line":"22 *----------------------------------------------------------------------------------------------------*;"},{"version":1,"type":"source","line":"23 "},{"version":1,"type":"source","line":"24 *----------------------------------------------------------------------------------------------------*;"},{"version":1,"type":"source","line":"25 * SAS Programme inkludieren;"},{"version":1,"type":"source","line":"26 *----------------------------------------------------------------------------------------------------*;"},{"version":1,"type":"source","line":"27 "},{"version":1,"type":"source","line":"28 options cashost=\"rviap0v02.dst.tk-inline.net\" casport=5570;"},{"version":1,"type":"source","line":"29 "},{"version":1,"type":"source","line":"30 filename job filesrvc folderpath='/TKbisy/Pilot/UC Versicherungspfade/02 Sequential Rule Mining/Archiv/' filename='SAS Coaching"},{"version":1,"type":"source","line":"30 ! Action Set Pathing SAS Beispiel Daten.sas';"},{"version":1,"type":"source","line":"31 %include job /source;"},{"version":1,"type":"note","line":"NOTE: %INCLUDE (level 1) file JOB is file SAS Coaching Action Set Pathing SAS Beispiel Daten.sas."},{"version":1,"type":"source","line":"32 +"},{"version":1,"type":"source","line":"33 +*----------------------------------------------------Lauffähiges Programm mit \"proc cas pathing\""},{"version":1,"type":"source","line":"33 !+----------------------------------------------------"},{"version":1,"type":"source","line":"34 +----------------------------------------------------auf SAS Beispieldaten ----------------------------------------------------;"},{"version":1,"type":"source","line":"35 +"},{"version":1,"type":"source","line":"36 +"},{"version":1,"type":"source","line":"37 +/*Dokumentation Action Set: Sequence Action Set */"},{"version":1,"type":"source","line":"38 +/* https://documentation.sas.com/?docsetId=casanpg&docsetVersion=8.3&docsetTarget=n0gse7erokgd4un1gvqze... +"},{"version":1,"type":"source","line":"40 +"},{"version":1,"type":"source","line":"41 +/* Libname */"},{"version":1,"type":"source","line":"42 +cas casauto;"},{"version":1,"type":"note","line":"NOTE: The session CASAUTO connected successfully to Cloud Analytic Services rviap0v02.dst.tk-inline.net using port 5570. The UUID "},{"version":1,"type":"note","line":" is 8454dae2-c4f4-f148-a79f-48762d8ec39c. The user is P226526 and the active caslib is CASUSERHDFS(P226526)."},{"version":1,"type":"note","line":"NOTE: The SAS option SESSREF was updated with the value CASAUTO."},{"version":1,"type":"note","line":"NOTE: The SAS macro _SESSREF_ was updated with the value CASAUTO."},{"version":1,"type":"note","line":"NOTE: The session is using 4 workers."},{"version":1,"type":"source","line":"43 +libname mycas cas caslib=public;"},{"version":1,"type":"note","line":"NOTE: Libref MYCAS was successfully assigned as follows: "},{"version":1,"type":"title","line":" The SAS System"},{"version":1,"type":"title","line":""},{"version":1,"type":"note","line":" Engine: CAS "},{"version":1,"type":"note","line":" Physical Name: 8454dae2-c4f4-f148-a79f-48762d8ec39c"},{"version":1,"type":"source","line":"44 +"},{"version":1,"type":"source","line":"45 +"},{"version":1,"type":"source","line":"46 +/* What CAS sessions do I have running? */"},{"version":1,"type":"source","line":"47 +cas _all_ list;"},{"version":1,"type":"note","line":"NOTE: Session CASAUTO is ACTIVE using port 5570 and host rviap0v02.dst.tk-inline.net for user P226526. The session UUID is "},{"version":1,"type":"note","line":" 8454dae2-c4f4-f148-a79f-48762d8ec39c."},{"version":1,"type":"source","line":"48 +"},{"version":1,"type":"source","line":"49 +"},{"version":1,"type":"source","line":"50 +/* Zugriff auf die importierte Daten über print */"},{"version":1,"type":"source","line":"51 +/* eigener Import über \"Daten vorbereiten\" */"},{"version":1,"type":"source","line":"52 +/* Datei liegt hier: C: … */"},{"version":1,"type":"source","line":"53 +/* Daten sind Online hier zu finden http://support.sas.com/documentation/onlinedoc/viya/exampledatasets/retailbuys.csv */"},{"version":1,"type":"source","line":"54 +proc print data=mycas.retailbuys (obs=5);"},{"version":1,"type":"source","line":"55 +run;"},{"version":1,"type":"note","line":""},{"version":1,"type":"note","line":"NOTE: PROCEDURE PRINT used (Total process time):"},{"version":1,"type":"note","line":" real time 0.15 seconds"},{"version":1,"type":"note","line":" cpu time 0.04 seconds"},{"version":1,"type":"note","line":" "},{"version":1,"type":"note","line":""},{"version":1,"type":"source","line":"56 +"},{"version":1,"type":"source","line":"57 +"},{"version":1,"type":"source","line":"58 +/* Sequenzanalyse */"},{"version":1,"type":"source","line":"59 +proc cas;"},{"version":1,"type":"source","line":"60 + sequence.pathing / table={caslib=\"public\" name=\"retailbuys\"}"},{"version":1,"type":"source","line":"61 + item=\"product\""},{"version":1,"type":"source","line":"62 + time=\"proc_time\""},{"version":1,"type":"source","line":"63 + tran=\"customer_id\""},{"version":1,"type":"source","line":"64 + casOutSequTranMap={caslib=\"public\" name=\"casouttable\", replace=true}"},{"version":1,"type":"source","line":"65 + casout={caslib=\"public\" name=\"retailsequence\", replace=true}"},{"version":1,"type":"source","line":"66 + ;"},{"version":1,"type":"source","line":"67 + run;"},{"version":1,"type":"note","line":"NOTE: Active Session now CASAUTO."},{"version":1,"type":"note","line":"NOTE: Added action set 'sequence'."},{"version":1,"type":"normal","line":""},{"version":1,"type":"source","line":"68 +quit;"},{"version":1,"type":"note","line":""},{"version":1,"type":"note","line":"NOTE: PROCEDURE CAS used (Total process time):"},{"version":1,"type":"note","line":" real time 1.89 seconds"},{"version":1,"type":"note","line":" cpu time 0.07 seconds"},{"version":1,"type":"note","line":" "},{"version":1,"type":"note","line":""},{"version":1,"type":"source","line":"69 +"},{"version":1,"type":"source","line":"70 +"},{"version":1,"type":"source","line":"71 +"},{"version":1,"type":"source","line":"72 +/* Regellängen ermitteln */"},{"version":1,"type":"source","line":"73 +title \"Regellängen\";"},{"version":1,"type":"source","line":"74 +proc fedsql sessref=casauto;"},{"version":1,"type":"source","line":"75 + select distinct"},{"version":1,"type":"source","line":"76 + _ChainLength_ as ANZ_ChainLength_"},{"version":1,"type":"source","line":"77 + from"},{"version":1,"type":"source","line":"78 + public.retailsequence;"},{"version":1,"type":"source","line":"79 +quit;"},{"version":1,"type":"note","line":""},{"version":1,"type":"note","line":"NOTE: PROCEDURE FEDSQL used (Total process time):"},{"version":1,"type":"note","line":" real time 0.45 seconds"},{"version":1,"type":"title","line":" The SAS System"},{"version":1,"type":"title","line":""},{"version":1,"type":"note","line":" cpu time 0.01 seconds"},{"version":1,"type":"note","line":" "},{"version":1,"type":"note","line":""},{"version":1,"type":"source","line":"80 +title;"},{"version":1,"type":"source","line":"81 +"},{"version":1,"type":"source","line":"82 +"},{"version":1,"type":"source","line":"83 +*----------------------------------------------------ENDE Lauffähiges Programm mit \"proc cas pathing\""},{"version":1,"type":"source","line":"83 !+----------------------------------------------------;"},{"version":1,"type":"source","line":"84 +"},{"version":1,"type":"note","line":"NOTE: %INCLUDE (level 1) ending."},{"version":1,"type":"source","line":"85 %JESEND"},{"version":1,"type":"note","line":""}],"count":159,"limit":159,"links":[]}
That is the answer from the SAS Technical Support - Workaround:
+++
Please see the SAS code at the bottom of this memo. This code will read the JSON file and convert it to a more readable format (workaround)
You can also view the log file with a JSON file viewer. For example, this JSON validator will format
the file in a more readable format (but the above-mentioned SAS program will create an output file that is
prettier).
https://jsonlint.com/
=================================================================================
options ls=max nodate nonumber;
%let PATH = C:\temp;
%let INFILE = Job Complaints_rperala_December 23, 2019 10_04_47 AM_log.json.log;
%let OUTFILE = Job Complaints_rperala_December 23, 2019 10_04_47 AM_log.json..htm;
libname jsonlog json "&PATH\&INFILE";
ods _all_ close;
title "Log File: &INFILE";
ods html5 path="&PATH" file="&OUTFILE" style=HTMLBlue;
proc report data=jsonlog.items;
columns type line;
define type / display noprint;
define line / display '' style(column)=[fontfamily=monospace borderwidth=0px];
compute line;
if (type eq 'note')
then call define('line', 'style', 'style=[color=blue]');
endcomp;
run; quit;
ods html5 close;
+++
In Viya 3.5 the log file will be available in text format when you select "Download" to see the job log file in Environment Manager
if you add the following parameter to your job, the EnvironmentManager should be updated in to handle both JSON and text log >> _omitTextLog false
Thanks for your answer... I expected a simple SAS log. Do you know if this is the intended format or can I change it by changing a setting in the browser?
Cheers, Klaus
That is the answer from the SAS Technical Support - Workaround:
+++
Please see the SAS code at the bottom of this memo. This code will read the JSON file and convert it to a more readable format (workaround)
You can also view the log file with a JSON file viewer. For example, this JSON validator will format
the file in a more readable format (but the above-mentioned SAS program will create an output file that is
prettier).
https://jsonlint.com/
=================================================================================
options ls=max nodate nonumber;
%let PATH = C:\temp;
%let INFILE = Job Complaints_rperala_December 23, 2019 10_04_47 AM_log.json.log;
%let OUTFILE = Job Complaints_rperala_December 23, 2019 10_04_47 AM_log.json..htm;
libname jsonlog json "&PATH\&INFILE";
ods _all_ close;
title "Log File: &INFILE";
ods html5 path="&PATH" file="&OUTFILE" style=HTMLBlue;
proc report data=jsonlog.items;
columns type line;
define type / display noprint;
define line / display '' style(column)=[fontfamily=monospace borderwidth=0px];
compute line;
if (type eq 'note')
then call define('line', 'style', 'style=[color=blue]');
endcomp;
run; quit;
ods html5 close;
+++
In Viya 3.5 the log file will be available in text format when you select "Download" to see the job log file in Environment Manager
if you add the following parameter to your job, the EnvironmentManager should be updated in to handle both JSON and text log >> _omitTextLog false
We created a free tool to convert a Viya JSON log to text format: https://sasjs.io/log-parser/
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!