I was hoping to be able to do it without having to resort to something like that but... The operators are supposed to limit user profiles to 8 characters but this isn't always the case, such as with some old profiles.
I suppose your limited to the 8 if you have to use SNDDST. Regarding the operators creating user profiles, there is an exit point to the CRTUSRPRF command that you could employ to enforce your 8-character limit.
The 8-character limit is a misnomer. The User ID portion of the User ID/Address combination can be any value. After you assign the user profile name & email address to the directory entry, obtain the email address by querying the tables qatmsmtpa and qaokp01a for that user profile.
The problem I'm having is identifying the correct user id for the the user profile currently signed on. The Snddst needs to be sent to the user id, but the only information I have is the user profile
Since you've already established the profiles longer than eight characters, could you make the ID the profile dropping the last two characters (assuming you have not exceeded ten characters)? At least, the sort would be simple. You may want to make it a policy for the operator's that accounts are to be no longer than eight characters using naming standards unique to the user. We use the employee number proceeded with a letter (same letter for all accounts). I know many companies include the last name in the account and when the last name changes either a new account needs to be created or the user must continue using their previous name.
Could you create a file, say in QTEMP, using the DSPDIRE command to a *OUTFILE, then use the value in the WOSDDEN field found in the resulting file rather than the value in the WODUSRP field?
If user profile is 10 characters (ABCDEABCDE), enter first 8 (ABCDEABC) characters into WRKDIRE's User ID. If duplicate found change last character to a digit. In SNDDST, use "Internet Recipient" parameter: e.g. ABCDEABCDE@mycompany.com instead of the "Recipient:User ID Address" parameter. Now all you have to do is use RTVJOBA to get User ID (i.e. profile)
I wound up writing a CL program that displays the directory entries for the specified user profile to an output file, then reads the output file. It returns the user/address combination that you need for SNDDST. Code
I am trying to configure SMTP and generally have it working, however, I have hit upon 1 problem. I have created a number of Directory entries for my users, and linked them to an SMTP address. I can then do a SNDDST and they receive the email. There are a few of my users who have a user profile more than 8 characters long. Because the DIRE User ID has to be 8 characters long, I have to truncate the user profile and just put the user profile into the appropriate field. Again, SNDDST from a command line sends fine to these user ID's. My problem comes when I try to use my SNDDST in a CL pgm. The idea of the program is to email a copy of a work file to the user that created the file. I do this by putting the job user profile into the User ID of my SNDDST command. However, the users with long profiles blow the CL out because their profile does not match the user ID. Basically, the user profile does not match the user ID. Any ideas how I can get around this? Many thanks Code
Are you firmly committed to SNDDST? If you're open to trying something different then you might want to look into Giovanni B. Perotti's Easy400, http://www.easy400.net/en The e-mail facility provided there is easy to use and more flexible than SNDDST. All source is included and, to me at least, is a tour-de-force. There are commands and CL's for emailing a variety of file types, and the system has it's own address book. Tom D.
Comment