List Server Information
*** Use it as a guideline ***
pgm
dcl &NSDate *char 7 /* NetServer start date */
dcl &X00 *char 1 value( x'00' )
dcl &a_pos *char 4 /* Data Start Pos.-Binary */
dcl &InfoQual *char 15 value( '*ALL ' )
/* Create a *usrspc to work with... */
call QUSCRTUS ( +
'NETS QTEMP ' +
'TMPLST ' +
x'00001000' +
X'00' +
'*ALL ' +
'Temporary IFS space ' +
'*YES ' +
x'0000000000000000' +
)
/* List NetServer status info into our *usrspc... */
call QZLSLSTI ( +
'NETS QTEMP ' +
'ZLSL0400' +
&InfoQual +
x'0000000000000000' +
)
/* Get the starting position of the list from the header... */
call QUSRTVUS ( +
'NETS QTEMP ' +
x'0000007D'
x'00000004' +
&a_pos +
)
/* NetServer Start-Date is at offset 60 into the list... */
chgvar %bin( &a_pos ) ( %bin( &a_pos ) + 60 + 1 )
/* Get the NetServer Start-Date from the *usrspc... */
call QUSRTVUS ( +
'NETS QTEMP ' +
&a_pos +
x'00000007' +
&NSDate +
)
/* If the StartDate is binary zeroes, then NetServer isn't started... */
if ( %sst( &NSDate 1 1 ) *eq &X00 ) do
sndusrmsg 'NetServer is NOT active.' tomsgq( *EXT )
enddo
/* ...otherwise NetServer is started... */
else do
sndusrmsg 'NetServer IS active. ' tomsgq( *EXT )
enddo
return
endpgm
Thanks to Tom Liotta
阅读(781) | 评论(0) | 转发(0) |