27.04.2013 Views

MVS Jan 2005.p65 - CBT Tape

MVS Jan 2005.p65 - CBT Tape

MVS Jan 2005.p65 - CBT Tape

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

parameter values for verification purposes. The ATTACH program<br />

name (in this case, ATTPGM1) must be right padded with blanks<br />

if the program name is less than 8 characters. */<br />

i1 = ATTACH("ATTPGM1 ",&attach_work1,<br />

&ecb1,&tcb1,NULL,&j,25Ø,"abcdef");<br />

i2 = ATTACH("ATTPGM1 ",&attach_work2,<br />

&ecb2,&tcb2,NULL,&k,1Ø24,"123456");<br />

i3 = ATTACH("ATTPGM1 ",&attach_work3,<br />

&ecb3,&tcb3,NULL,4Ø96,k,"987654");<br />

/* Isolate the task complete indicator bit in the ECB and wait for<br />

each subtask to complete. */<br />

c1 = ecb1;<br />

d1 = c1 >> 24;<br />

e1 = d1 & ØxØØØØØØ4Ø;<br />

c2 = ecb2;<br />

d2 = c2 >> 24;<br />

e2 = d2 & ØxØØØØØØ4Ø;<br />

c3 = ecb3;<br />

d3 = c3 >> 24;<br />

e3 = d3 & ØxØØØØØØ4Ø;<br />

while (e1 == Ø ]] e2 == Ø ]] e3 == Ø)<br />

{<br />

sleep(1);<br />

c1 = ecb1;<br />

d1 = c1 >> 24;<br />

e1 = d1 & ØxØØØØØØ4Ø;<br />

c2 = ecb2;<br />

d2 = c2 >> 24;<br />

e2 = d2 & ØxØØØØØØ4Ø;<br />

c3 = ecb3;<br />

d3 = c3 >> 24;<br />

e3 = d3 & ØxØØØØØØ4Ø;<br />

}<br />

/* The subtasks have all completed. DETACH and terminate the parent<br />

program. */<br />

i1 = DETACH(&tcb1,"STAE");<br />

i2 = DETACH(&tcb2,"STAE");<br />

i3 = DETACH(&tcb3,"STAE");<br />

return(Ø);<br />

}<br />

ATTPGM1 ASM<br />

***********************************************************************<br />

* This program is a test program used to test out the ATTACH() *<br />

* function. The sample driver C program TESTATT is used to *<br />

* ATTACH this test program any number of times. This program *<br />

* expects an incoming parameter that contains the address of the *<br />

* incoming parameter list. Three parameters are passed to this *<br />

44 © 2005. Xephon USA telephone (214) 340 5690, fax (214) 341 7081.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!