|
Reggie: OpsNav is one way, but won't help if you need to tell in a running program. The List Server Information (QZLSLSTI) API can help. There's some basic CL code pasted below that _should_ work for V4R3 and above. Use it as a guideline. Tom Liotta midrange-l-request@xxxxxxxxxxxx wrote: > 2. How to tell if Netserver is active? (Reggie Acosta) > >Where do I look and what do I look for to see if Netserver is active? I'm on >v4r3. --- begin 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 --- end -- -- Tom Liotta The PowerTech Group, Inc. 19426 68th Avenue South Kent, WA 98032 Phone 253-872-7788 x313 Fax 253-872-7904 http://www.powertechgroup.com __________________________________________________________________ Try AOL and get 1045 hours FREE for 45 days! http://free.aol.com/tryaolfree/index.adp?375380 Get AOL Instant Messenger 5.1 for FREE! Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.