The objective is to gather the relevant information together to enable you to track Threads, Client ID, user, and messages. The raw log output can be difficult to pull relevant information from. This program helps extract and organize the data for debugging.
The program is easily understood using DATA Step code. The output can be manipulated by the user as needed.
The form is 9.2 logging.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
filename LogLine "C:\_today\temp\spawnerserver.log";
/* Standard SAS 9.2 Server Log4SAS Conversion Pattern, in the form of: */
/* */
/* */
data log4line;
infile LogLine recfm=V lrecl=512 pad missover ;
length Log_Header $1;
length Log_Line $512;
input Log_Header $ 1 @;
/* drop a header and trailer line in the log file */
if ( Log_Header = 'H' ) or (Log_Header = 'L') then DELETE;
input @1 Log_Line $ 512.;
drop Log_Header;
run;
data log4data;
set log4line;
format L_DateTime datetime23.3; label L_DateTime='DateTime';
length L_Level $ 5; label L_Level='Diagnostic Level';
length L_Thread $ 8; label L_Thread='Active Thread';
length L_ClientID $ 8; label L_ClientID='Client ID';
length L_ActiveUserid $ 8; label L_ActiveUserid='Active Userid';
length L_LogLineL 8; label L_LogLineL='Log Line Length';
length ServerLine $ 512; label ServerLine='Server Message';
length ServerLineL 8; label ServerLineL='Server Message Length';
L_LogLineL = length(Log_Line);
L_DateTime = input(scan(Log_line,1, " "),B8601DT23.3);
L_Level = substr(Log_line, 25, 5);
L_Thread = substr(Log_Line, index(Log_line,'[') + 1, 8);
Line_Ptr = index(Log_Line, ']') + 2;
L_ClientID = substr(Log_line, Line_Ptr, 1);
if L_ClientID = ':' then do;
L_ClientID = ' ';
Line_Ptr = Line_Ptr + 1;
L_ActiveUserid = substr(Log_line, Line_ptr, index(Log_line, ' - ') - Line_Ptr);
end;
else do;
ServerLine = substr(Log_line, Line_Ptr, index(Log_Line, ' - ') - Line_Ptr);
L_ClientID = scan(ServerLine, 1, ':');
L_ActiveUserid = scan(ServerLine, 2, ': ');
end;
/* Extract Server Message Details */
Line_Ptr = index(Log_Line, ' - ') + 3;
ServerLine = '';
ServerLineL = 0;
if (L_LogLineL > Line_Ptr) then do;
ServerLine = substr(Log_Line, Line_Ptr, L_LogLineL - Line_Ptr);
ServerLineL = length(ServerLine);
end;
drop Line_Ptr;
run;
proc print data=log4data label; run;
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Diagnostic Active Client Active Log Line Obs DateTime Level Thread ID Userid Length 97 21OCT2010:17:30:01.695 INFO 00012029 148 SYSTEM@d 112 98 21OCT2010:17:30:01.757 INFO 00012031 sasadm@s 266 99 21OCT2010:17:30:01.773 INFO 00012037 149 SYSTEM@d 112 100 21OCT2010:17:30:01.804 INFO 00012039 sasadm@s 266 101 21OCT2010:17:30:01.820 DEBUG 00012043 150 sasadm@s 99 102 21OCT2010:17:30:01.820 INFO 00012043 150 sasadm@s 123 103 21OCT2010:17:30:01.820 INFO 00000013 SYSTEM@d 182 104 21OCT2010:17:30:01.867 INFO 00000003 SYSTEM@d 295 Obs Server Message 97 Client connection 148 for user sasadm@saspw closed 98 New client connection (149) accepted from server port 8561 for user sasadm@saspw. Encryption 99 Client connection 149 for user sasadm@saspw closed 100 New client connection (150) accepted from server port 8561 for user sasadm@saspw. Encryption 101 START Perf.ARM.IOM.OMI.Server.Pause 0 102 PauseRepository Id=A0000001, Name=REPOSMGR, PauseState=OFFLINE 103 User libref, RPOSMGR, deassigned from path, C:\SAS\EMMFSTM\Lev1\SASMeta\MetadataServer\rposmg 104 AVL Index, ID, for dataset, I0000005.RPOSCTRL, was used 0 times with an average of 0 selectio
Type: | Sample |
Date Modified: | 2010-12-03 10:12:27 |
Date Created: | 2010-11-23 08:31:42 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | N/A | z/OS | ||
Z64 | ||||
OpenVMS VAX | ||||
Macintosh | ||||
Macintosh on x64 | ||||
Microsoft Windows 2000 Professional | ||||
Microsoft® Windows® for 64-Bit Itanium-based Systems | ||||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | ||||
Microsoft Windows XP 64-bit Edition | ||||
Microsoft® Windows® for x64 | ||||
OS/2 | ||||
Microsoft Windows 95/98 | ||||
Microsoft Windows 2000 Advanced Server | ||||
Microsoft Windows 2000 Datacenter Server | ||||
Microsoft Windows 2000 Server | ||||
Microsoft Windows NT Workstation | ||||
Microsoft Windows Server 2003 Datacenter Edition | ||||
Microsoft Windows Server 2003 Enterprise Edition | ||||
Microsoft Windows Server 2003 Standard Edition | ||||
Microsoft Windows Server 2003 for x64 | ||||
Microsoft Windows Server 2008 | ||||
Microsoft Windows Server 2008 for x64 | ||||
Microsoft Windows XP Professional | ||||
Windows 7 Enterprise 32 bit | ||||
Windows 7 Enterprise x64 | ||||
Windows 7 Home Premium 32 bit | ||||
Windows 7 Home Premium x64 | ||||
Windows 7 Professional 32 bit | ||||
Windows 7 Professional x64 | ||||
Windows 7 Ultimate 32 bit | ||||
Windows 7 Ultimate x64 | ||||
Windows Millennium Edition (Me) | ||||
Windows Vista | ||||
Windows Vista for x64 | ||||
64-bit Enabled AIX | ||||
64-bit Enabled HP-UX | ||||
64-bit Enabled Solaris | ||||
ABI+ for Intel Architecture | ||||
AIX | ||||
HP-UX | ||||
HP-UX IPF | ||||
IRIX | ||||
Linux | ||||
Linux for x64 | ||||
Linux on Itanium | ||||
OpenVMS Alpha | ||||
OpenVMS on HP Integrity | ||||
Solaris | ||||
Solaris for x64 | ||||
Tru64 UNIX |