- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - NonStop OS
- >
- An odd but highly complex question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2015 12:02 PM
09-23-2015 12:02 PM
An odd but highly complex question
I am working in a COBOL shop and I am wondering if it is possible to extract a field name from a string (PIC X(30)) variable and be able to then access that data element in memory.
What we are doing is attempting to create a process that will read through a database that contains field names in a PIC X(30) field. Then using that field name access that data element in the program. For example...
Data Elements in Working Storage
01 DATA.
05 DE-ELEMENT-1 PIC X(02).
05 DE-ELEMENT-2 PIC 9(04).
05 DE-ELEMENT-3 PIC 9(06)V9(02).
An external table holds a single field
01 PROCESSING-FIELD PIC X(30).
And assume it holds these 2 rows as text strings
DE-ELEMENT-1
DE-ELEMENT-3
What I am looking for is a way to process through the values in the external table and perform tasks on the fields listed in there. The program we are looking at is attempting to log changes to fields but only specific fields are being checked. So in this case we woudl only process on DE-ELEMENT-1 and DE-ELEMENT-3 and not DE-ELEMENT-2.
We are attempting to make this a table driven check because we have had to change the list of fields many times already and it requires a code promotion each time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2015 05:49 AM
09-26-2015 05:49 AM
Re: An odd but highly complex question
I haven't used COBOL in decades.
It seems you need to dynamically select fields based on names. I don't think there is any easy way to do this except with a big EVALUATE verb with the list of every field you might want to change.
Your problem will be even harder since DE-ELEMENT-1 & DE-ELEMENT-3 have different PICs.