Basic Functions > File Formats > A.3 Session File/Journal File
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX''">   
A.3 Session File/Journal File
 
Justification for Session Files
A session file serves a variety of purposes. A session file is a compact method of storing an entire model or just individual operations; it contains no database. A session file is a text file containing a series of directives (e.g., PCL commands) to be executed. These directives can be used to re-create a model from scratch, be a transaction log for review and/or modification, used as a macro/subprogram for performing a sequence of commands repetitively, or support site and/or project customization. In addition, Patran can process most ASM NOODL’s contained in PATRAN 2.5 session files.
Recording Session Files
Session files can be recorded from current models. Session files are designed to contain any combination of comments, PCL (PATRAN Command Language), executable statements and most ASM NOODL commands. Each command entered into the command line either directly by the user (e.g., keyboard input, history recall) or indirectly (commands indicated as “events of interest” by applications) are recorded.
Session File Names
By convention, session files are named “<file>.ses”. The first portion <file> is a user selectable base file name. The second portion, “ses”, is the standard session file extension. In addition, a file revision is appended to all session files. Session files created by Patran have revision numbers that are either specified manually or generated automatically. If a session file name is supplied without any extension (indicated by the presence of a “.” in the file name), the standard extension “.ses” is automatically appended.
Revision numbers are at least 2 digits long (starting with “01”) to facilitate the listing of session files in increasing numerical order.
Note: Revisions greater than “99”are not listed in numerical order on the forms.) Automatically generated revision numbers are always created as one (1) greater than the highest existing revision number. Gaps in revision numbers are not automatically filled in by the system.
For recording session file, the supplied name is checked for existence. If this file does exist, then a new revision (starting with “01”) is created.
In order to play a session file, the supplied name is also checked for existence. If this file does not exist, then the highest existing revision of this file is used. If no revision exists, then no file is played.
Session File Contents
Session files are text files that may contain PCL statements or NOODL commands. No single physical line may exceed 256 characters. The logical line length limit is 7000 characters.
Session files are designed to support the PCL comment marker ($). In addition, there are two special cases of comments that are written to a session file. Any comment lines that do not contain one of these two special comment markers will be written unchanged to the recording session file. None of these lines are executable, but may have varying results during playback of a session file and the recorded session file.
System comments ($#)
Patran writes out certain comments using the system comment marker. These include messages about session file start and end information. When a session file is read, any lines with this marker are ignored and not displayed in the history window or recorded in the recording session file. A user can enable and disable the writing of these comments using the PCL built-in command verbose.
Message responses ($?)
The execution of certain statements may require a response from the message facility. This marker is used to indicate a line is a message response. On playback, if a response is required, the system first attempts to satisfy it from these stored message responses. If a response is encountered in a session file but not required, it is ignored. All valid or unneeded message responses are preserved; wrong responses are deleted. The form of a message response is as follows:
$? <response> <msg number> <partial text of message>
Any line that has a message number (<msg number>) value of -1 will match any message number.
Journal File
A journal file contains, a listing of the commands in all the session files ever created, since the creation of the database. Although the format of the journal file is identical to the session file, a separate session file is created each time the database is opened, while the single journal file is only appended. The journal file is used as input to the rebuild database utility. See File>Rebuild, 77 for more information.