# GETPRG

> [HTML Version](getprg_sbr.htm)

_Updated August 2017_

**xcall GETPRG, prgnam \{,sbxnam, svr'prgnam, svr'prgver, prgdir, sbxdir\}**

GETPRG returns the name and associated attributes for the current program and SBX routine, with some ATE client/server options. 

**Parameters**

| **Parameter** | **Type** | **I/O** | **Description** |
|------|------|------|------|
| prgnam | [String](string.md) | out | Returns program name; no extension, stripping of trailing spaces |
| sbxnam | [String](string.md) | in/out | If specified, it also returns the name of the current routine (if called from within a subroutine). Otherwise, set to "". |
| svr'prgnam | [String](string.md) | out | Applies only to subroutines running in the ATE client context (e.g. launched via AG\_XFUNC); it returns the name of the program currently running on the server. Otherwise it will return a null string. |
| svr'prgver | [String](string.md) | out | Also only applies to the ATE client context, returning the version of the program currently running on the server. Example format: 1.2A(345) |
| prgdir | [String](string.md) | out | Returns the device:\[p,pn\] where the program (prgnam) was loaded from.  Example format:  DSK22:\[123,456\]. If the program was loaded directly from memory, it will return a null string. |
| sbxdir | [String](string.md) | out | Same as prgdir, but for the last called SBX. |


