Q. Does anyone know of a way to run an initial program for a certain terminal? That is, to run a program upon sign-on from a specified terminal no matter who signs on.
A. To do what you're after, follow these steps:
1. Create a job description (give it the same name as the workstation) and specify the RTGDTA parameter. For example, if the display station is named DSP25, do:
CRTJOBD JOBD(xxx/DSP25) + RTGDTA('DSP25')
2. Add a workstation entry to the interactive subsystem (QINTER) for the workstation, referencing the job description just created:
ADDWSE SBSD(QINTER) + WRKSTN(DSP25) + JOBD(xxx/DSP25) AT(*SIGNON)
3. Add a routing entry to the interactive subsystem, referencing the program you want to run:
ADDRTGE SBSD(QINTER) +
SEQNBR(...) CMP + VAL('DSP25') PGM(...)
This will happen when the user signs on, the system checks the workstation entry and discovers that it has a job description attached. It examines the job description and finds routing data DSP25. Then it goes through the routing entries, matches the DSP25 in the CMPVAL parameter, and executes the program you named in the PGM parameter.