Micro Focus Community
Micro Focus Community
  • Site
  • User
  • Site
  • Search
  • User
Micro Focus Community
  • Blogs
  • Ask & Explore
  • Community Guide
  •  

    Menu

    ×
  1. Welcome
  2. Application Delivery Management

      Application Delivery Management

      ×
    1. AccuRev
    2. Agile Manager
    3. ALM / Quality Center
    4. ALM Octane
    5. Business Process Testing
    6. Deployment Automation
    7. Dimensions CM
    8. Dimensions RM
    9. LoadRunner Cloud
    10. LoadRunner Enterprise
    11. LoadRunner Professional
    12. Micro Focus Connect
    13. Model-Based Testing
    14. Project and Portfolio Mgmt.
    15. PVCS Version Manager
    16. Release Control
    17. Requirements Management
    18. Service Virtualization
    19. Silk Central
    20. Silk Performer
    21. Silk Test
    22. StarTeam
    23. UFT Developer
    24. UFT Mobile
    25. UFT One
    26. ValueEdge Platform
  3. Application Modernization & Connectivity

      Application Modernization & Connectivity

      ×
    1. AMC-INTL
    2. ChangeMan SSM
    3. ChangeMan ZMF
    4. COBOL Analyzer
    5. Comparex
    6. Enterprise Analyzer
    7. Enterprise Developer
    8. Enterprise Server
    9. Enterprise Test Server
    10. Extend / AcuCOBOL
    11. Extra!
    12. Host Access for the Cloud
    13. Host Access Mgmt/Security Server
    14. Micro Focus and AWS Partnership
    15. Net Express / Server Express
    16. Network Virtualization
    17. OpenFusion
    18. Orbacus
    19. Orbix
    20. Reflection
    21. RM/COBOL
    22. Rumba
    23. StarTool
    24. Verastream
    25. VisiBroker
    26. Visual COBOL
  4. CyberRes

      CyberRes

      ×
    1. CyberRes User Group
    2. ArcSight
    3. File Analysis Suite
    4. File Dynamics
    5. File Reporter
    6. Fortify
    7. Galaxy
    8. NetIQ Access Manager
    9. NetIQ AD Bridge
    10. NetIQ Advanced Authentication
    11. NetIQ Change Guardian
    12. NetIQ Data Access Governance
    13. NetIQ Directory & Resource Administrator
    14. NetIQ eDirectory
    15. NetIQ Group Policy Administrator
    16. NetIQ Identity Governance
    17. NetIQ Identity Manager
    18. NetIQ LDAP Proxy
    19. NetIQ Privileged Account Manager
    20. NetIQ Risk Service
    21. NetIQ Secure API Manager
    22. NetIQ Secure Configuration Manager
    23. NetIQ SecureLogin
    24. NetIQ Security Solutions for IBM i
    25. NetIQ Self Service Password Reset
    26. NetIQ Validator
    27. SecureData
    28. SecureMail
    29. Sentinel
    30. Structured Data Manager
    31. Voltage
  5. Information Management & Governance

      Information Management & Governance

      ×
    1. Content Manager
    2. ControlPoint
    3. Data Protector
    4. eDiscovery
    5. IDOL
    6. Retain
    7. Storage Manager
    8. VM Explorer
  6. IT Operations Management

      IT Operations Management

      ×
    1. Aegis
    2. AppManager
    3. Asset Management
    4. Client Automation
    5. Data Center Automation
    6. Hybrid Cloud Management
    7. Network Operations Management (NNM and Network Automation)
    8. Operations Bridge
    9. Operations Center
    10. Operations Orchestration
    11. OPTIC (ITOM Platform)
    12. PlateSpin
    13. Robotic Process Automation
    14. Service Management Automation
    15. Service Request Center (SRC)
    16. Service Support Manager (SSM)
    17. SMA-Service Manager Suite
    18. SMAX Suite
    19. Solutions Business Manager
    20. Storage Operations Manager
    21. Universal Discovery & CMDB
  7. Team Collaboration and Endpoint Management
  8. Control Tower
  9. Micro Focus Marketplace
  10. Technical Insights Series
  • User
  • Site
  • Search
  • User
    Visual COBOL
    Community Home › Application Modernization & Connectivity › Visual COBOL › Visual COBOL - Tips & Information

    Visual COBOL

    • Home
    • Discussions
    • Tips & Info
    • AMC Blog
    • News & Events
    • New
    • Visual COBOL - Tips & Information
    • (VC) Support Tip: Visual COBOL supports code refactoring
    • (VC) Support Tip: Visual COBOL Eclipse Docker Videos
    • (VC) Support Tip: Visual COBOL supports xUnit style testing framework
    • Accessing RM Data files from Managed Visual COBOL
    • Adding controls to a .NET WPF application
    • Adding Print Preview/Screen Print Functionality to a Windows Form
    • Advanced - Visual COBOL Customer Video
    • Announcing Data Tools AddPack for Visual COBOL
    • Building JVM COBOL Web Service Applications from a Build Infrastructure
    • C#/Java COBOL interop made easy with SmartLinkage
    • C#/Java COBOL interop made easy with SmartLinkage - please give us your feedback
    • Calling Visual COBOL .NET classes from Net Express native programs
    • Case Study: APRA AMCOS Tunes Up Application Performance
    • Case Study: Breaking down the monolith: FordonsData embraces Agile and DevOps with Visual COBOL
    • Case Study: FordonsData Nordic AB
    • Case Study: Jury Systems
    • COBOL Data Groups
    • COBOL on Azure
    • COBOL – Here’s to the Next 60 Years
    • COBOL60 – Shaping the Future of Core Business Applications, Live Webinar am 12. Mai 2020
    • Coming Soon... Local Variables in Managed COBOL
    • Commenting out code in multiple source files using Visual Studio
    • Creating JSP web applications using Visual COBOL for Eclipse
    • Creating web applications using Visual COBOL and ASP.NET
    • CTF Trace Incomplete; Only Contains Last Portion of Trace
    • Demo of COBOL Using P/Invoke with CALL and C# style DLLImport
    • Demo: Developing and Deploying CGI application in Visual COBOL for Eclipse
    • Deploying COBOL Applications for Docker in Eclipse
    • Desired region not available for Service/EJB deploy in Visual COBOL for Eclipse
    • Determine whether COBOL is running in a Docker container
    • DevOps and API Development in the Cloud: Visual COBOL 5.0 Product Launch
    • Differences between DEBUG and RELEASE builds in managed code?
    • Displaying a different Tooltip image for each dataGridView row
    • Eclipse debugging when COBOL programs invoked by Application Server process
    • Environment Variables in VisualCOBOL
    • Generate code documentation when building Visual COBOL Applications
    • Getting Started with Visual COBOL for Eclipse
    • Getting Started with Visual COBOL for Visual Studio
    • How to get count of how many lines of code in project / workspace
    • How to handle multiple forms in a Windows Forms Application
    • How to set and retrieve a session variable for a current Web Form in ASP.NET - A simple example
    • How to setup C and COBOL (Calling C module) projects in Visual COBOL for Eclipse
    • Install Error '0x8007000a - The environment is incorrect' at MS Tools download/install stage
    • Installation Issue
    • Invoking COBOL EJB, Enterprise Server reporting a program could not be loaded
    • Join our COBOL FB group
    • JVM COBOL - Getting Started
    • Knowledge Doc: COBOL project files (.cblproj) are flagged as incompatible in solution explorer.
    • Knowledge Doc: Error message: COBDB0006S Required DB software 'DB2INSTANCE' could not be found - SQL processing cannot continue.
    • Knowledge Doc: Installing Certificates for use under Visual COBOL for Eclipse
    • Knowledge Doc: Sentinel RMS License Manager service locks up
    • Lessons Learned: Moving from Net Express to Visual COBOL
    • Live Webinar: Visual COBOL 5.0 - DevOps & API-Entwicklung in der Cloud, 17. Juli (in German)
    • lservnt.exe fails with exception 0xc0000005
    • Managed COBOL - An Overview
    • Managed COBOL – JVM COBOL & .NET COBOL Syntax
    • Managing directives by using comments in directive files
    • Recommended Diagnostics for Memory Corruption Errors : RTS252
    • Relativity Designer 2.3 incompatibility with Visual COBOL 7.0
    • RPM Patch Update install error "... conflicts with file from package ..."
    • Runtime error 114 when embedding ActiveX-Control in a DialogSystem screenset
    • Screen Section UNDERLINE attribute is not showing up on ACCEPT statement
    • String Handling in Managed COBOL
    • Support Tip: 244 Licensing Initialization Error
    • Support Tip: AutoPass logs do not get generated in a Windows environment
    • Support Tip: Cataloged DSN (ODBC) does not appear in OpenESQL Assistant (Visual Studio 2022)
    • Support Tip: Divide By Zero
    • Support Tip: Enabling logs for troubleshooting AutoPass licensing issues
    • Support Tip: Error message: ### Autopass not configured. when trying to install *.xml (autopass) license file
    • Support Tip: How many special name switch statements allowed in code and in runtime options.
    • Support Tip: How to call Native COBOL from Native JAVA project, passing data such as string
    • Support Tip: Installation error: "0x81f40001 - Micro Focus <name_of_product> has not been detected."
    • Support Tip: Installing Visual COBOL 7.0 fails
    • Support Tip: JSON GENERATE with when-phrase
    • Support Tip: Load error 179 when launching RUN.EXE
    • Support Tip: Moving native applications with fixed format source files to managed code
    • Support Tip: OpenESQL Assistant Error: Unhandled Exception: System.AccessViolationException
    • Support Tip: The License was applied, however it does not seem to be correct for the installed product
    • Support Tip: Truncation of field values in JVM COBOL Debugger
    • Support Tip: Unable to install - The license string does not appear to be valid
    • Support Tip: Unable to install more than one version of Visual COBOL on the same machine
    • Support Tip: Unable to install Safenet license on SUSE Linux 15
    • Support Tip: Visual COBOL 7.0 can't see copy files with extensions greater than 10 characters
    • Support Tip: Visual COBOL 7.0 supports Dynamic Length data-items
    • Support Tip: Visual COBOL 8.0 now supports .NET 6
    • Support Tip: Visual COBOL 8.0 now supports Visual Studio 2022
    • Support Tip: Visual COBOL can be used to deploy and call SOAP and REST Web Services (Videos)
    • Support Tip: Visual COBOL extension for Visual Studio Code available
    • Support Tip: Visual COBOL supports DECLARE statement in native, .NET and JVM code
    • Support Tip: Visual COBOL supports new intrinsic functions to test the validity of a given date
    • Support Tip: Visual COBOL supports PIC U data type to store UTF-8 data
    • Support Tip: Writing trailing spaces in line sequential files
    • Tech Tips: Debugging COBOL code in Visual Studio - Breakpoints and Watchpoints
    • Tech Tips: Debugging COBOL code in Visual Studio – Data Items
    • Tech Tips: Projecting COBOL into the future (pun intended)
    • Testing the Visual Studio and Eclipse IDE
    • Using Labels with Visual COBOL
    • Using Owner Drawn Tooltips in a Windows Form in Visual COBOL 2010
    • VCCOMDemo.zip Sample program
    • Video Case Study: Advanced US
    • Video: Integrative Ansätze für die COBOL-Entwicklung : Application Workflow Modeller in der Praxis
    • Video: APRA AMCOS Visual COBOL Customer Presentation
    • Video: COBOL Web Services (In German)
    • Video: Debugging in Eclipse Advanced with Visual COBOL
    • Video: Deploying COBOL Applications for Docker in Eclipse
    • Video: Installing Visual COBOL Support for Docker
    • Video: Integration der COBOL Entwicklungsprozesse mit dem Application Workflow Modeller (in German)
    • Video: Introduction to Visual COBOL for Eclipse
    • Video: Visual COBOL 6.0 - Refactoring Preview
    • Visual Cobol installer briefly shows splash screen and then closes
    • Visual COBOL - JVM Web Services Portal
    • Visual COBOL 2.1 - JSP Web Services Tutorial
    • Visual COBOL 2.1 - Web Services Environment Configuration
    • Visual COBOL 2.2 - JSP Web Services Tutorial
    • Visual COBOL 2.2 - REST Web Services Tutorial
    • Visual COBOL 2.2 - SOAP Web Services Client Tutorial
    • Visual COBOL 2.2 - SOAP Web Services Tutorial
    • Visual COBOL 2.2 - Web Services Environment Configuration
    • Visual COBOL and .NET Arrays
    • Visual COBOL and COBOL for .NET Language Introduction
    • Visual COBOL ASP.NET Shopping Cart Demonstration
    • Visual Cobol Information (in German, Italian, Russian and Spanish)
    • Visual Cobol instalation ROOT
    • Visual COBOL Personal Edition V8.0 is now available for download!
    • Visual COBOL R4 Installer Technology
    • Visual COBOL supports digital banking strategy and delivers 65% faster time-to-market
    • VISUAL COBOL, .NET and Microsoft Office combined is a great opportunity for a little CRM
    • Watchpoints in Visual Studio
    • Web Site or Web Application ?
    • Webinar: Utilia S.p.A. un caso di eccellenza tutto italiano! Jun 3, 2020 (in Italian)
    • Working with Buttons in Visual COBOL
    • Working with CheckBoxes in Micro Focus Visual COBOL
    • Working with Textboxes in Visual COBOL
    • Working with the DataTimePicker in Visual COBOL

    You are currently reviewing an older revision of this page.

    • History View current version

    Determine whether COBOL is running in a Docker container

    QUESTION: 

    Visual COBOL includes support for running inside Docker containers. Is there a way a program can determine whether it's running within a container?

     

    HOW TO STEPS:

    The built-in routine CBL_GET_OS_INFO, can provide information about the COBOL product in use, and the environment in which it's running. As part of the support for working with containers, this routine has been enhanced to return a new bit flag to indicate whether the program is running in a Docker container.

    When the routine is invoked, it returns a parameter block. One of the items returned is described as "Runtime System Capabilities", and a bit within that item indicates if a container is in use.

    The attached program is a demonstration of this functionality. It creates a simple report that shows the Product Version, and whether the program is running on a full O/S or within a container.

    The program uses the new BIT-OF function in Visual COBOL 6.0 to convert this information into an alphanumeric string for easy interrogation:

     

     

     

    determine-docker. * The BIT-OF function is new in Visual COBOL 6.0... move function BIT-OF (cblte-osi-rts-capabilities) to expanded-bits

     

     

     

    And then an 88 level COBOL condition is used to test the value:

     

     

     

    evaluate true when running-on-docker move "Running in a Docker Container" to docker-status when other move "Running on full O/S" to docker-status end-evaluate

     

     

     

    Here's a sample of the report produced by the example program:

     

     

     

    Current Product Version: 6 Container Status: Running in a Docker Container

     

     

     

    The complete program is attached below.

    DockerDemo.zip
    DockerDemo.zip
    DockerDemo.zip

    Resources

    Support
    Documentation
    Training
    CyberRes Academy
    Partner Portal
    Contact us
    Compliance
    Help
    Company
    Privacy Policy
    Terms of Use
    Accessibility
    Anti-Slavery Statement
    Support
    How To Buy
    Careers
    Investor Relations
    Follow Us
    © 2021 Micro Focus
    The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.