.PAGE SIZE 55, 68 .CENTER Printing out Pending ALL-IN-1 Mail .BLANK.CENTER (during Login, etc.) .BLANK.CENTER using Datatrieve. .BLANK 2.CENTER B. Z. Lederman .BLANK.CENTER ITT World Communications .BLANK.CENTER New York, NY 10004-2464 .BLANK.PARAGRAPH I recently received a telephone call from a user seeking a way to find out during user login if there is any pending mail in ALL-IN-1. He stated that he had been told that you can have a program written for you by your local Software Services organization, but that he really wasn't in the position to spend the money. I was unable to find a public domain program which would do it, but it later occurred to me that it could be done fairly easily with Datatrieve. (I home he sees this article!). .PARAGRAPH First, you need the record definition for the pending mail file used by ALL-IN-1: .BLANK.NO JUSTIFY.NO FILL DELETE AI1__PENDING__RECORD; REDEFINE RECORD AI1__PENDING__RECORD OPTIMIZE 01 AI1__PENDING__REC. ! ! Read the ALL-IN-1 PENDING data file. ! ! B. Z. Lederman ! 10 PENDING__KEY PIC X(65) EDIT__STRING T(32). 10 C USAGE BYTE EDIT__STRING SZZ9. 10 A USAGE WORD EDIT__STRING SZZ,ZZ9. 10 B USAGE WORD EDIT__STRING SZZ,ZZ9. 10 D PIC XX. 10 HIDE. 20 FILLER PIC X(8). 10 REAL REDEFINES HIDE. 20 E PIC X(8). 10 ENUM PIC 9(8) COMPUTED BY E EDIT__STRING ZZ,ZZZ,ZZ9. 10 FILLER PIC X(1920). ; .BLANK You also have to define a domain which uses this record: .BLANK DELETE AI1__PENDING; REDEFINE DOMAIN AI1__PENDING USING AI1__PENDING__RECORD ON OA$DATA:PENDING.DAT; .BLANK.JUSTIFY.FILL I have not quite figured out what AI1 is doing with all of these fields, but I am reasonably certain what two of them are. PENDING__KEY contains the name of the user queues (there are MAIL entries and message router queue entries), and ENUM contains the number of unread messages. I am using a COMPUTED#BY field here because the data file contains the number with leading blanks, and I want to treat it as a numeric value. If all I ever wanted to do was print out the number, such as I am doing here, I could just use field E. .PARAGRAPH Once there is a domain which accesses this data, it's fairly easy to find out how many messages are waiting: .BLANK.NO JUSTIFY.NO FILL DELETE PRINT__PENDING; REDEFINE PROCEDURE PRINT__PENDING ! ! Find out how much ALL-IN-1 Electronic Mail is Pending ! ! B. Z. Lederman ! READY AI1__PENDING SHARED DECLARE KEY__FIELD PIC X(65). ! ! Get the pre-defined user name and make it into a retrieval key ! KEY__FIELD = "MAIL " | FN$TRANS__LOG ("USER__NAME") ! FOR AI1__PENDING WITH PENDING__KEY = KEY__FIELD PRINT "Pending Messages = ", ENUM(-) ! FINISH END-PROCEDURE .BLANK.JUSTIFY.FILL The reason I'm translating a logical name here is because I'm assuming that the user would want to set up one procedure that could be used by everybody in the system (invoked from SYLOGIN.COM, for example), rather than hard-coding a dedicated version for each individual user. For this to work, you have to define a logical name which translated to the users' name: assuming that the UIC field translates to the users' name (as it usually does), you could do something like the following in DCL to retrieve the users' name, strip off the square brackets of the UIC format, define the logical name, and invoke the print procedure: .BLANK.NO JUSTIFY.NO FILL $ temp__name = F$USER() $ end = F$LOCATE("]", temp__name) $ end = end - 1 $ temp__name = F$EXTRACT(1, end, temp__name) $ DEFINE user__name 'temp__name $ DTR; :CDD$TOP.DTR$USERS.ALLIN1.PRINT__PENDING .BLANK.JUSTIFY.FILL Note that this requires that you define DTR as $SYS$SYSTEM:DTR32 or something similar so you can put DTR commands in on the DCL command line. You would probably want to put the procedure PRINT__PENDING in some central directory to which everyone has read/execute access.