These functions are especially useful when you have to check the status of the agent jobs running across multiple servers (they will all have different GUIDS).
The first function looks up the agent job id from the sysjobs table. The second function looks up the job status from the sysjobactivity table and returns either one of the following 7 results:
0 - Not executing
1 - Current executing
2 - Waiting for thread
3 - Between retries
4 - Faileure during last run
5 - Suspended
6 - (not used)
7 - Performing completion actions
NULL - Job does not exists
So by easily passing in an agent job name, you can get the current executing status on any given server.