ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to convert a screen program in to batch

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to convert a screen program in to batch

    I had a program that has several screen user interactions, I changed the program not to show any screen and to pick the user inputs base on a file. This works fine interactively but not in submit to batch. Can someone please help me to resolve this problem?
    Thank You,

    Chanaka

  • #2
    Re: How to convert a screen program in to batch

    Where are the files with the user input? These are possibilities.
    1. They are in a library not on the library list for your submitted job.
    2. They are in QTEMP for your interactive job and then when you submit a new job they won't be available.
    Ben

    Comment


    • #3
      Re: How to convert a screen program in to batch

      You cannot handle Display Files in Batch!
      ... except you override your display file and set DEV to the jobname immediately before calling the program (containing the display file):

      PHP Code:
      OVRDSPF    FILE(&DSPFTOFILE(&LOGLIB/&DSPFDEV(&JOB) +  
                              
      OVRSCOPE(*JOB
      But as soon as you'll execute an EXTFMT your program will fail anyway!!!

      Birgitta

      Comment


      • #4
        Re: How to convert a screen program in to batch

        I assumed he wasn't using a display file as Chanaka said they are now picking up user inputs from a file.
        Ben

        Comment


        • #5
          Re: How to convert a screen program in to batch

          Originally posted by chanaka
          but not in submit to batch.
          Chanaka
          Hi,
          You don't give enough information. We won't be able to help you with only "it doesn't work"...
          What are the symptoms? any message?
          Could give us more details about what doesn't work, please ?
          Did you leave the display file declaration ? (Fxxxx CF E WORKSTATION) etc.
          Jean-Michel

          Comment


          • #6
            Re: How to convert a screen program in to batch

            Declare the workstation file as user open, and don't open it.
            Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

            Comment


            • #7
              Re: How to convert a screen program in to batch

              Thanks friends for quick responds,
              With this information I made the display file to be user open (open the file only when the program runs interactive). But I have a problem when reading and writing information to closed display file. My next attempt is to override the file. I easily can avoid the EXFMT but not the reading and writing because I have a doubt the sub file information might be using to update files at the end.

              Thank You,
              Chanaka

              Comment


              • #8
                Re: How to convert a screen program in to batch

                Originally posted by B.Hauser View Post
                You cannot handle Display Files in Batch!
                ... except you override your display file and set DEV to the jobname immediately before calling the program (containing the display file):

                PHP Code:
                OVRDSPF    FILE(&DSPFTOFILE(&LOGLIB/&DSPFDEV(&JOB) +  
                                        
                OVRSCOPE(*JOB
                But as soon as you'll execute an EXTFMT your program will fail anyway!!!

                Birgitta
                Hi Birgitta,

                Will i be able to use READ and WRITE except EXFMT ...?

                Comment


                • #9
                  Re: How to convert a screen program in to batch

                  You can not write to closed files.
                  You can not write / read display formats in batch.

                  So clone this pgm with out having the screen formats. Just make a work file with the same formats and use them as an external data structure.
                  Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

                  Comment


                  • #10
                    Re: How to convert a screen program in to batch

                    Yo uhave to check to see if the program is running in interactive or batch mode.

                    If its interactive, then open the display file, process the display file, and submit the program to batch.

                    If its in batch mode, do not open the display file and do not do any display file processing.
                    Michael Catalani
                    IS Director, eCommerce & Web Development
                    Acceptance Insurance Corporation
                    www.AcceptanceInsurance.com
                    www.ProvatoSys.com

                    Comment


                    • #11
                      Re: How to convert a screen program in to batch

                      I guess if you can change device to your current job/workstn name then it will allow you to open display file and debug program easily. If you cant really change file definition n have no option
                      Device . . . . . . . . . . . . . Name, *REQUESTER

                      Comment

                      Working...
                      X