Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298648
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2010-06-05 09:12:21

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) |
给主人留下些什么吧!~~