Best Practices for the Clickstream Sessionize Transformation

Backing Up PERMLIB

When the Clickstream Sessionize transformation has completed execution, any sessions that are still considered open have data stored in a permanent library that has the default libref, PERMLIB. This information is used to process the next Web log in a series when user sessions span across Web logs. The next time that the Clickstream Sessionize transformation executes, if possible, a user's open session data in PERMIB will be combined with session data for that user in the current run. In this way, a complete record for a user can be captured across different runs of the clickstream job.
Make sure you back up the contents of PERMLIB before each execution of the Clickstream Sessionize transformation in a clickstream job. If the Clickstream Sessionize transformation should fail for some reason, and the tables in PERMLIB are in an unknown state, then the backup can be restored and the job can be rerun. The physical path to PERMLIB is specified in the library definition on the Options tab in the properties window for the Clickstream Sessionize transformation, in the Tables section.

Managing the Contents of PERMLIB

If you use a clickstream job to reprocess the same data multiple times, as you might do when developing a new clickstream job, be sure to return PERMLIB to the state it was in before the last execution. If PERMLIB was empty, then its contents should be removed. If PERMLIB contained tables, then the tables should be restored to the state they were in before the last execution. Otherwise, duplicate data appears in the output table for the Clickstream Sessionize transformation.
An easy way to remove the tables contained in PERMLIB is to add code similar to the following in the Precode panel on the Precode and Postcode tab:
libname permlib '<your PERMLIB path goes here>'; 
proc datasets lib=permlib kill nowarn nolist; 
run;
Remove this pre-code when you are ready to run the job in production so that session data is correctly connected across executions of the job. The nolist option prevents a job warning if the PERMLIB directory is empty when you execute this code.