sponsored links

Collapse

Announcement

Collapse
No announcement yet.

Populating USRID() in the SNDDST command?

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

  • Populating USRID() in the SNDDST command?

    SNDDST is the lowest common denominator for sending out an email.
    I am passing a number of parameters into a CLLE program and building the *LMSG command.
    Because this will be running at other locations I want to pass in the User Profile parameter so only one profile has to be set up with a directory entry no matter the user profile of the batch job the command will be executed from.

    https://www-01.ibm.com/support/knowl.../cl/snddst.htm

    User identifier (USRID)

    Specifies which user ID and user ID address should be associated with the request.

    *CURRENT
    You are performing the request for yourself.
    user-ID
    Specify another user's user ID or your user ID. You must have been given permission to work on behalf of another user or have *ALLOBJ authority.
    user-ID-address
    Specify another user's address or your address. You must have been given permission to work on behalf of another user or have *ALLOBJ authority.



    The manual says USRID is a two part entry USRID(USRID SYSTEM) like the directory entry. But when I pass in a string and populate like USRID(&USERID) I get the following types of errors.

    Here I passed in a cut and paste of the Directory entry with two blanks between the user and system name.
    Value 'MFASSIST ' for USRID exceeds 8 characters.
    List item value for parameter USRID required.
    Error found on SNDDST command.

    Here I used a single space between the user and system name.
    Value 'MFASSIST S' for USRID exceeds 8 characters.
    List item value for parameter USRID required.

    If I only pass the user profile name and not the system part...
    List item value for parameter USRID required.
    Error found on SNDDST command.

    What is the correct way to populate this parameter.??? (other than *CURRENT)

    Thanks.

  • #2
    Re: Populating USRID() in the SNDDST command?

    Oh my, I bet it is USRID(&USR &ADDR)??? How come you always figure it out while your asking about it? I will let you know if this works. thanks all.

    Comment


    • #3
      Re: Populating USRID() in the SNDDST command?

      Yeah, if you go WRKDIRE and see the User ID and Address columns, that's the actual format you feed it. 8 characters, 1 space and 8 characters.

      If you F9=Retrieve a success SNDDST command on command line in one session you can actually copy and paste from your WRKDIRE list on another session back into the USRID address to test sending with different values.

      It doesn't have to be 8,1,8 format either when you're building the USRID parameter. If your User ID is 5 positions it can be USRID(ABCDE SYSADDR).

      You want to bear in mind a few things:

      - User ID in WRKDIRE and IBM i user profile name are not mutually inclusive. They can be the same, but aren't required to be. User ID is 8 characters, so in cases where the IBM i profile is greater they have to be different.

      - The user profile the job is running under will need to be set up with a Distribution Directory Entry to send.

      - That distribution User ID will need to have authority to the User ID you are building into the SNDDST command on the USRID profile, either by having *ALLOBJ or by GRTUSRPMN.

      - The system address in the WRKDIRE for established users doesn't necessarily match the actual system name from RTVNETA (or similar method).

      There are other considerations as well...if you want to e-mail to have a certain return e-mail address and such.

      Jeff

      Comment


      • #4
        Re: Populating USRID() in the SNDDST command?

        Thanks Jeff,
        I got it working this morning. You do have to give it two variables, one with the user profile and the second with system. A single variable with both will not work. I needs to see two pieces.. USRID(&USR &SYS) works. USRID(&USRSYS) where &USRSYS = 'USERPRF1 SYSTEM01' does not work. Thanks for taking the time to replay.

        David,
        I would love to have a snappy saying as a signature, but I'm not a snappy person. I am a firesign theater lover, if you lived here you would be home by now.

        Comment


        • #5
          Re: Populating USRID() in the SNDDST command?

          Gotcha, I am not much help with passing command parameters which was more specific to your problem. I should have forewarned you on that.

          Comment

          sponsored links

          Collapse

          Working...
          X