
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Efficient way to get owner id for a filename in cobol program
For security, want to retrieve files from a directory by owner ID (%username%)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Efficient way to get owner id for a filename in cobol program
Good morning.
Have you tried with:
ACCEPT TERMINAL-ABILITIES FROM TERMINAL-INFO
ACCEPT SYSTEM-INFORMATION FROM SYSTEM-INFO
See Format 3 (ACCEPT FROM), Steps 7 and 8.
You will obtain useful information, either you are executing your program locally (wrun32.exe/runcbl) or via Thin Client.
If you want to inquire information about the files themselves, you can use C$FILEINFO, or CALL a Windows API such as KERNEL32.DLL and use one of its modules.
Claudio Contardi
Product Support Engineer, Senior
Micro Focus

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Re: Efficient way to get owner id for a filename in cobol program
C$fileinfo would be good except returns only date time and file size, I believe.
Not familiar with calling api's in a cobol application

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Betreff: Efficient way to get owner id for a filename in cobol program
Hi,
i would use WMI.
It is easy to use with cobol as OLE Programming.. like accessing word, excel and so on.
i also have a example here in the forum how i do a ping with wmi in cobol.
TO use WMI u need to create a .def File with AXDEFGEN.
The needed object is for WMI then the @WbemScripting
The next i would use this Example https://devblogs.microsoft.com/scripting/how-can-i-determine-the-owner-of-a-file/ to convert it to a cobol code.
Greetings
David