IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this community and its apps will no longer be available. More details available on our FAQ.
Topic
  • 6 replies
  • Latest Post - ‏2019-09-10T07:41:16Z by Sergey Chebotarev
Sergey Chebotarev
Sergey Chebotarev
16 Posts

Pinned topic Creating a display file programmatically

‏2019-09-06T05:10:46Z |

Good day. Tell me, is it possible to create a display file from the program? For example, a program has 2 parameters: a physical file and a record number. The program should determine which fields in the physical file, create a display file to display these fields and display the field values on the screen with the specified record number.

Thank.

  • JonParis
    JonParis
    345 Posts
    ACCEPTED ANSWER

    Re: Creating a display file programmatically

    ‏2019-09-06T14:06:54Z  

    Simple answer - yes.  Although ti is much easier to create a browser-based app than a green screen.

    Option 1:  Write a program to generate the DDS and RPG from the input parameter, compile it and run it.

     

    Option 2: Use the DSM (Dynamic Screen Manager) APIs. These are designed to be used from C but can be used from RPG or COBOL.

     

    Option 3: Use a display file that contains nothing much other than a big blank field. Write a generic program that formats the data for display complete with column headings etc. Not easy and adding input capability is awkward.

     

    Option 4: If limited display file capability is acceptable then use UPDDTA - the utility behind PDM option 18.

     

    This sounds a bit like an interview question but I'll assume you are serious.

  • Andreas Bott
    Andreas Bott
    20 Posts
    ACCEPTED ANSWER

    Re: Creating a display file programmatically

    ‏2019-09-09T08:15:18Z  

    Hi,

     

    there is an API Finder Website to search for API Docs: https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_74/apifinder/finder.htm

    Perhaps you have to Chnage to another Release.

     

    Type 'Dyn' and you come to the Result !

     

    Have Fun :-)

    Updated on 2019-09-09T14:29:39Z at 2019-09-09T14:29:39Z by Andreas Bott
  • JonParis
    JonParis
    345 Posts

    Re: Creating a display file programmatically

    ‏2019-09-06T14:06:54Z  

    Simple answer - yes.  Although ti is much easier to create a browser-based app than a green screen.

    Option 1:  Write a program to generate the DDS and RPG from the input parameter, compile it and run it.

     

    Option 2: Use the DSM (Dynamic Screen Manager) APIs. These are designed to be used from C but can be used from RPG or COBOL.

     

    Option 3: Use a display file that contains nothing much other than a big blank field. Write a generic program that formats the data for display complete with column headings etc. Not easy and adding input capability is awkward.

     

    Option 4: If limited display file capability is acceptable then use UPDDTA - the utility behind PDM option 18.

     

    This sounds a bit like an interview question but I'll assume you are serious.

  • Sergey Chebotarev
    Sergey Chebotarev
    16 Posts

    Re: Creating a display file programmatically

    ‏2019-09-09T06:01:10Z  

    Jon, I'm serious. It seems that option 2 suits me, since I write more in C / C ++. Could you ask for a link to the IBM documentation for these APIs?

  • Andreas Bott
    Andreas Bott
    20 Posts

    Re: Creating a display file programmatically

    ‏2019-09-09T08:15:18Z  

    Hi,

     

    there is an API Finder Website to search for API Docs: https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_74/apifinder/finder.htm

    Perhaps you have to Chnage to another Release.

     

    Type 'Dyn' and you come to the Result !

     

    Have Fun :-)

    Updated on 2019-09-09T14:29:39Z at 2019-09-09T14:29:39Z by Andreas Bott
  • Sergey Chebotarev
    Sergey Chebotarev
    16 Posts

    Re: Creating a display file programmatically

    ‏2019-09-09T09:49:22Z  

    Andreas, thank you! Found an API and even an example of showing a window. I will study!

  • JonParis
    JonParis
    345 Posts

    Re: Creating a display file programmatically

    ‏2019-09-09T14:32:54Z  

    Jon, I'm serious. It seems that option 2 suits me, since I write more in C / C ++. Could you ask for a link to the IBM documentation for these APIs?

    This is the 7.4 docs link Sergey. https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_74/apis/dsm.htm  Just in case you have yet to find it.

    There used to be a number of examples out on the web but most were on the iPro De velour web site and they have dumped the site and its content sadly.

    I may have one or two examples buried somewhere but have no time to dig them out right now.  You could ask the folks on Midrange.com there are a few who hang out there who have used them.

  • Sergey Chebotarev
    Sergey Chebotarev
    16 Posts

    Re: Creating a display file programmatically

    ‏2019-09-10T07:41:16Z  

    Jon, thanks. If you suddenly find, I will be very grateful!