/* BEGIN DOCUMENTATION Name: RSXTSK Created: 07/26/83 J Mele Last Update: 03/06/84 W Epp Title: Generate an RSX multiuser task name Index: Abstract: Generate an RSX multiuser task name. Usage: DCL RSXTSK ENTRY(CHAR(*)) RETURNS(CHAR(6)) task_name = RSXTSK(prefix) Parameters: prefix IN CHAR(*) [VARYING] - task name prefix (first 3 chars used) Environment: RSX-11M, AIS PL/I Description: This function constructs a task name using the same conventions RSX does in giving each concurrent user a separate copy of one installed task image. This is needed if you have one application composed of more than one task, you want it to appear to the user as if it was just one task, and you want more than one user to be able to use it concurrently - the user runs the main task (and is automatically provided with his own copy by RSX), and the main task must run the subsidiary tasks, getting a separate copy for each user by giving a unique task name for each. The unique task name consists of the first three letters of the prefix (supplied by the argument) followed by the type and unit number of the user's terminal (TI:). You abort a task run with such a task name by giving the prefix - the DCL ABORT command recalculates the task name by the same rules. For example, if run with task name RSXTSK('CRUNCH'), you can say ABORT CRUNCH or ABO CRU (the actual task name will be CRUT6 if your TI: is TT6). The prefix may be less than three characters long for running a task, but then abort will not work. Example(s): TASKNAME = RSXTSK('RIA'); CALL SPAWN(RAD50('MCR...'), . . ., 'RUN DM4:[20,20]FILER/TASK='!!TASKNAME, . . .); Internal: Update History: NONE END DOCUMENTATION */ rsxtsk: procedure(prefix) returns(char(*)); /* returns task name */ dcl prefix char(*) varying, prefix3 char(3) varying, taskname char(6), dsw fixed bin(15), getlun entry(fixed bin(15),*,fixed bin(15)), octal entry(fixed bin(15)) returns(char(6) varying), lun_info(0:5) fixed bin(15), pluninfo pointer initial(addr(lun_info)), 1 luninfo /*defined(lun_info)*/ based(pluninfo), 2 devname_char1 char(1), 2 devname_char2 char(1), 2 devnum fixed bin(7); call getlun(1, lun_info, dsw); /*We know that PL/I assigns lun 1 to TI*/ if dsw<0 then do; put skip list('Error on GLUN$ for TI: dsw = ',dsw); signal error; end; prefix3 = prefix; /*1st 3 chars, or all without blanks, if < 3*/ call upcase(prefix3); taskname = prefix3 !! luninfo.devname_char1 !! octal(luninfo.devnum); return(taskname); end rsxtsk;