Migrating an existing Gen 8.6 Mainframe/COBOL server application to .NET/C#.
The client remains a Gen Windows GUI C client.
The system attribute USER_ID is used extensively in server action blocks and under the Mainframe COBOL servers is passed from the client.
However the USER_ID is not available on .NET servers.
As stated in the Gen 8.6 documentation section "Distributed Processing > Working With Distributed Processing > Anatomy of a DP Application > Server Execution Environments". Under "Behavior Differences", the USER_ID is not available for a .NET C# Server:
"Obtaining a user ID context for a DPS that populates the USER_ID system attribute is not available when the DPS operates as a Java EJB or .NET Server."
If the system attribute CLIENT_USER_ID is not already in use for application security, it can be set as required on the client and then passed to the server.
/* return SecurityNotUsed; */return SecurityUsedStandard;userId parameter being populated for the latter and then passed on the flow.***** // Populate USER_ID system attribute in server views. // The default behavior is to return null. // if you want set USER_ID, return the user id you want to set, or set the user id from the client user id as illustrated in the comments below. // If the returned string length is greater than 8, it will be truncated within the Runtime to keep the first 8 characters. public string SetUSERID() { if (!string.IsNullOrEmpty(_clientUserId)) { return _clientUserId; } // return null; }
*****
return _clientUserId.TrimEnd();Other Gen 8.6 documentation references: