ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Signed on users

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Signed on users

    I'm not sure where this question should be asked so I will try here:

    Is there a way to get a list of signed on users. I know I can go to WRKACTJOB but is there anyway that I can get a cleaner list?
    Race Car spelled backwards is Race Car

  • #2
    Re: Signed on users

    The answer is yes....I will locate some source for you tonight
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Signed on users

      Provided all your signed on users are in QINTER you can use the system command
      WRKSBSJOB SBS(QINTER) OUTPUT(*PRINT)

      Comment


      • #4
        Re: Signed on users

        You can but I do have an API example that list signed on users....
        I just dont remember where I put it


        I found it
        Code:
                  F****************************************************************
             F* OBJECT ID: USERS
             F* TEXT:      DISPLAY USER ACTIVITY
             F* Jun 28/03  S.R.Pascas
             F****************************************************************
            DD GeneralDs       DS
             D  InputSize            113    116B 0
             D  ListOffset           125    128B 0
             D  ListNbr              133    136B 0
             D  EntrySize            137    140B 0
             D InputDs         DS
             D  UserSpace                    20
             D ErrorDs         DS                  INZ
             D  BytesProvd             1      4B 0 INZ(116)
             D  BytesAvail             5      8B 0
             D  MessageId              9     15
             D  Err###                16     16
             D  MessageDta            17    116
             D                 DS                  INZ
             D  StartPosit             1      4B 0
             D  StartLen               5      8B 0
             D  SpaceLen               9     12B 0
             D  NbrEntries            29     32B 0
             D  LenEntry              37     40B 0
             D  NbrReturn             41     44B 0
             D  MaxEntries            45     48B 0
             d Mydata          s             25
             D SpaceAtrib      S             10
             D SpaceValue      S              1
             D SpaceAuth       S             10
             D SpaceText       S             50
             D SpaceReplc      S             10
             D FormatName      S              8
             D USERNAME        S             10    INZ('*ALL      ')
             D DSPSTATION      S             10    INZ('*ALL      ')
             D DISCONNECT      S             10    INZ('*NO       ')
             D SIGNEDOFF       S             10    INZ('*NO       ')
             D******************************************************************
             D*Structure for SGNU0200 format
             D******************************************************************
             DQEZU0200         DS
             D*                                             Qez SGNU0200
             D  QEZDSN00               1     10
             D*                                             Display Station Name
             D  QEZUN01               11     20
             D*                                             User Name
             D  QEZJNBR00             21     26
             D*                                             Job Number
             D  QEZIVITY00            27     36
             D*                                             Activity
             D  QEZAN00               37     46
             D*                                             Activity Name
             D  QEZDJ00               47     47
             D*                                             Disconnect Job
             D  QEZERVED00            48     64
             D*                                             Reserved
             D QEZDSD                 65    114
             D*                                             Display Station Description
             D QEZUD                 115    164
             D*                                             User Description
        
             d*  Error code data
             D ErrData         DS
             D   BytesProv             1      4B 0 Inz( 272 )
             D   BytesAval             5      8B 0
             D   ExcpId                9     15A
             D   Reserved             16     16A
             D   ExcpData             17    272A
             d*
             D STRING          S             71
             D ARRAY           s             71    DIM(1000)
        
             C                   EVAL      UserSpace = ('USERS     QTEMP')
              *  Create user space
             C                   CALL      'QUSCRTUS'
             C                   PARM                    UserSpace
             C                   PARM      *BLANKS       SpaceAtrib
             C                   PARM      2048          SpaceLen
             C                   PARM      *BLANKS       SpaceValue
             C                   PARM      '*CHANGE'     SpaceAuth
             C                   PARM      *BLANKS       SpaceText
             C                   PARM      '*YES'        SpaceReplc
             C                   PARM                    ErrorDs
              *
             C                   z-add     0             signedon          5 0
              *  List all objects in file
             C                   EVAL      UserSpace = ('USERS     QTEMP')
             C                   CALL      'QEZLSGNU'
             C                   PARM                    UserSpace
             C                   PARM      'SGNU0200'    FormatName
             C                   PARM                    USERNAME
             C                   PARM                    DSPSTATION
             C                   PARM                    DISCONNECT
             C                   PARM                    SIGNEDOFF
             C                   PARM                    ErrorDs
             C                   EVAL      StartPosit = 1
             C                   EVAL      StartLen = 140
              *  Retrieve user space general information
             C                   EVAL      UserSpace = ('USERS     QTEMP')
             C                   CALL      'QUSRTVUS'
             C                   PARM                    UserSpace
             C                   PARM                    StartPosit
             C                   PARM                    StartLen
             C                   PARM                    GeneralDs
              *  Retrieve the list by walking through the user space
             C                   EVAL      StartPosit =  1
             C                   EVAL      StartLen = inputsize
             C                   EVAL      UserSpace = ('USERS     QTEMP')
             C                   CALL      'QUSRTVUS'
             C                   PARM                    UserSpace
             C                   PARM                    StartPosit
             C                   PARM                    StartLen
             C                   PARM                    inputds
             C                   EVAL      StartPosit = ListOffset + 1
             C                   EVAL      StartLen = EntrySize
              *  Retrieve the list by walking through the user space
             C                   Z-ADD     0             INDX              4 0
              *
             C     listnbr       ifgt      0
             C                   DO        ListNbr
             C                   EVAL      UserSpace = ('USERS     QTEMP')
             C                   CALL      'QUSRTVUS'
             C                   PARM                    UserSpace
             C                   PARM                    StartPosit
             C                   PARM                    StartLen
             C                   PARM                    Qezu0200
             C                   EVAL      StartPosit = StartPosit + EntrySize
              *
              *
             c                   eval      mydata = qezun01 + Qezdsn00
             c     mydata        dsply                   reply             1
              *
             c                   enddo
             C                   endif
             c                   eval      *INLR = *on
        Attached Files
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: Signed on users

          Is there anyway I can get WRKSBSJOB SBS(QINTER) OUTPUT(*PRINT) to dump to a file?
          Race Car spelled backwards is Race Car

          Comment


          • #6
            Re: Signed on users

            just use the above API and replace

            Code:
              c     mydata        dsply                   reply             1
            the above line with a WRITE to a file you create.


            JImmy

            Comment


            • #7
              Re: Signed on users

              Before I make any changes, is this what the API is supposed to do?

              Display Program Messages

              DSPLY SUSZEKB QPADEV0021
              *N
              DSPLY IGNACIB QPADEV0029
              *N
              DSPLY SHAMASA QPADEV0011
              *N
              DSPLY ANDERSV QPADEV0024
              *N
              DSPLY ASCHENT QPADEV0031
              *N
              DSPLY SUSZEKB QPADEV0023
              *N
              DSPLY ANDERSV QPADEV0030
              *N
              DSPLY SWOPSPT QPADEV0006

              Type reply, press Enter.
              Reply . . .
              Race Car spelled backwards is Race Car

              Comment


              • #8
                Re: Signed on users

                Thos are just a couple of the fields returned from the API its the user id and the device they are signed on.

                Comment


                • #9
                  Re: Signed on users

                  Originally posted by Chevylover54
                  Is there anyway I can get WRKSBSJOB SBS(QINTER) OUTPUT(*PRINT) to dump to a file?
                  What you can do is: Locate the spool file through WRKSPLF and went through the spool file where your data has been copied. Now run command, CPYSPLF and mention the name of sppol file in it and PF where u want to copy the whole data. Now your data has been copied into SPLF. Wht you can do now is use of substring operation in RPG and retrieve/save all the user information in other PF and use accordingly. I would suggest you to make CLP for whole proceedure.

                  Comment

                  Working...
                  X