GDSX Manual

Using Pseudo Procedures in a NonStop TS/MP
Environment
Extended General Device Support (GDSX) Manual134303
D-28
USAMPLE2 Listing
400.
401. !===========================================================================
402. Proc USER^STOP (TCB);
403. !===========================================================================
404. Int .EXT TCB(TCB^TEMPLATE);
!gdsx
405. Begin
406. End;
407.
408.
409. !===========================================================================
410. Proc PROCESS^ASSIGNS (buf);
411. !===========================================================================
412. Int .buf;
413. Begin
414. End;
415.
416.
417. !===========================================================================
418. Proc PROCESS^USER^PARAMS (user^param^buf);
419. !===========================================================================
420. String .user^param^buf;
421. Begin
422. Literal eof = %377;
423. STRING xlate^user^parm^name = 'p' := [
424. !01234567890123 4 56789012345678 9
425. "USERPARAM1 ", 1, "USERPARAM2 ", 2,
426. eof ];
427.
428. STRING
429. .s := @user^param^buf ,
430. item^name [0:13] ;
433 use index; index := 0;
434. While xlate^user^parm^name [index] <> eof Do ! If within table
435. Begin
436.
437. item^name ':=' xlate^user^parm^name [index] for s; ! get table name
438. If item^name = s[1] for s Then ! param name found
439. Begin
440. @s := @s[s+1] ; ! point to param value
441. ! assign param value
442. ! set the desired parameter variable to parm value(s[1] FOR s)
443. goto try^next^param;
444. End
445. Else
446. index := index + 15; ! go to next param
447. End;
448. drop index;
449.
450. @s := @s [s+1]; ! name not found -- forget it
451.
452. try^next^param:
453. ! if multiple user parm messages are in one
string,
454. ! continue to process, otherwise return to TSCODE
455. Return; ! for further processing
456. End;
457.
458.
459. !===========================================================================
460. Int Proc USER^ATTRIBUTES (sg^cmd, sg^objtype, sg^objname, token^code,
461. token^value);
462. !===========================================================================
463.
464. Int sg^cmd , ! SPI command for this request
465. sg^objtype , ! object type for this request
466. .sg^objname , ! object name for this request
467. .token^value ; ! SPI token value for this token
468. INT(32) token^code ; ! SPI token code
469.
470. Begin
471. Return 0;
472. End;
473.