Created On: 17 October 2011
Problem:
How do you find in Acu4GL for MSSQL the unique SQL spid (process id)?
Resolution:
You can view the SPID in MSSQL using Activity Monitor etc or try using the function below.
ACUCOBOL-GT Appendices Version 9.0.1 Appendix I: Library Routines > I.1 General Syntax and Library List > C$GETPID
This routine returns the Process ID (PID) of the current process. This PID can be compared with the PID returned by the C$LOCKPID to determine if the current process is the one holding a file lock or record locked condition.
Usage
CALL "C$GETPID"
GIVING PROCESS-ID.
Parameters
PROCESS-ID PIC 9(n)
This contains a numeric data item large enough to hold a PID. On most platforms, PIC 9(5) is sufficient. On 64-bit systems, PIC 9(7) is recommended.
Comments
When called from a non-UNIX or non-Windows runtime, C$GETPID returns a PROCESS-ID of "0". This behavior should not be used for system identification. Use ACCEPT ... FROM SYSTEM-INFO instead (see Chapter 6 of Book 3).
ACUCOBOL-GT Appendices Version 9.0.1 Appendix I: Library Routines > I.1 General Syntax and Library List > C$GETPID
This routine returns the Process ID (PID) of the current process. This PID can be compared with the PID returned by the C$LOCKPID to determine if the current process is the one holding a file lock or record locked condition.
Usage
CALL "C$GETPID"
GIVING PROCESS-ID.
Parameters
PROCESS-ID PIC 9(n)
This contains a numeric data item large enough to hold a PID. On most platforms, PIC 9(5) is sufficient. On 64-bit systems, PIC 9(7) is recommended.
Comments
When called from a non-UNIX or non-Windows runtime, C$GETPID returns a PROCESS-ID of "0". This behavior should not be used for system identification. Use ACCEPT ... FROM SYSTEM-INFO instead (see Chapter 6 of Book 3).
Old KB# 34949
#Acu4GL
#spid
#mssql