home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!snorkelwacker.mit.edu!ira.uka.de!news.belwue.de!news.uni-ulm.de!news
- From: KARGL@rzmain.rz.uni-ulm.de (ComRam)
- Subject: Problem using $GETUAI
- Message-ID: <1992Nov5.184235.12119@wega.rz.uni-ulm.de>
- Sender: news@wega.rz.uni-ulm.de (News Net)
- Organization: Chaos Computer Club Ulm
- Date: Thu, 5 Nov 1992 18:42:35 GMT
- X-News-Reader: VMS NEWS 1.24
- Lines: 77
-
- Starting with the problem of finding the Real Name to a given Account I
- first wrote a little C program which does the job and works quite fine.
- Then I started to do the same thing in FORTRAN (Just for fun:-) and this
- one refuses to work. The SYS$GETUAI returns a SS$_BADCONTEXT. Can anyone
- tell me whats wrong with this thing?
-
- --------------------------------------------------------------------------
-
- * FINDREAL.FOR --- Find Owner Name --- (C) 1992 by ComRam
-
- PROGRAM Findreal
-
- IMPLICIT NONE
-
- INCLUDE '($JPIDEF)'
- INCLUDE '($UAIDEF)'
-
- CHARACTER*12 Username
- CHARACTER*32 Owner
-
- INTEGER Usernamelen,
- 1 Ownerlen,
- 2 Status,
- 3 I
-
- INTEGER SYS$GETJPI,
- 1 SYS$GETUAI
-
- STRUCTURE /ITMLST/
- INTEGER*2 BUFLEN,
- 1 CODE
- INTEGER*4 BUFADR,
- 1 RETLENADR
- END STRUCTURE
-
- RECORD /ITMLST/ JPI_LIST,
- 1 UAI_LIST
-
- JPI_LIST.BUFLEN = 12
- JPI_LIST.CODE = JPI$_USERNAME
- JPI_LIST.BUFADR = %LOC (Username)
- JPI_LIST.RETLENADR = %LOC (Usernamelen)
-
- Status = SYS$GETJPI (,,,JPI_LIST,,,)
-
- WRITE (*,*) '*',Username(1:Usernamelen),'*'
-
- DO I=Usernamelen,1,-1
- IF (Username(I:I) .NE. ' ') GOTO 10
- ENDDO
- 10 CONTINUE
-
- WRITE (*,*) 'I : ',I,' Username : *',Username(1:I),'*'
-
- UAI_LIST.BUFLEN = 32
- UAI_LIST.CODE = UAI$_OWNER
- UAI_LIST.BUFADR = %LOC (Owner)
- UAI_LIST.RETLENADR = %LOC (Ownerlen)
-
- Status = SYS$GETUAI (0,0,%DESCR(Username(1:I)),UAI_LIST,0,0,0)
-
- WRITE (*,*) 'Status : ',Status,' Owner : ',Owner
-
- STOP
- END
-
- ------------------------------------------------------------------------------
-
-
-
- ------------------------------------------------------------------------------
- ComRam (in real life : Frank Kargl) Student consultant for programming
- IP : COMRAM@RZ.UNI-ULM.DE University of Ulm Germany
- DECnet(Belwue) : 50186::KARGL All statements posted above are
- Bitnet : KARGL@DULRUU51.BITNET my personal oppinion ONLY !
- ------------------------------------------------------------------------------
- God created INTEGERS ... everything else was defined by mathematicians
-