ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Multiple instance of one display file having different data queue

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

  • Multiple instance of one display file having different data queue

    Hi guys,

    I have a cl program and a dspf. The program may run at same time in different session(different display device like qpadev0001,qpadev002,..) on same AS400 server. Im using data queue to find whether user gave any input from the display file(while compiling i gave the data queue name). since its running in many instances i created separate data queue for each instance that i know at runtime only. so i have to give the created data q name in the display file. i used the chgdspf command to give the data queue name at runtime. but now the problem is when i run the second instance of the program it waits in the chgdspf command of the second run. when i closed the first one, the second instance from different session started running.

    is it possible to have same display file having different data queue at different workstation at same time?? how to do it, please help guys.

  • #2
    Re: Multiple instance of one display file having different data queue

    why do you even need a dtaq for this? but anyway...CHGDSPF requires an exclusive lock on the object which is why the 2nd session "hangs up" until the 1st session exits the program using the display file....which is normal behavior. you should write your program to valid if any entry was made. there is no reason to try using a "magic bullet" for something so simple.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Multiple instance of one display file having different data queue

      Hi yuvarajgta:

      If each user has his/her own library......at the top of the library list

      When you compile you can use:
      Code:
       Data queue . . . . . . . . . . .   mydtaq
         Library  . . . . . . . . . . .      *libl
      Tom is correct....this is using a cannon to kill a mosquito

      Best of Luck
      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: Multiple instance of one display file having different data queue

        i mentioned only a part before. I need my display screen to auto refresh few data areas. I tried many ways to do it in a single clle program but I cannot create a single program to run in loop to check whether dataarea changed as well as to wait for user input. so i created another program that will run in batch in background repeatedly check whether data area value changed if changed then i need to refresh screen if user press other keys i need to perform other actions. So i need commnunication between these two programs. I created a data queue in each session, the batch program will post in data queue if data area changed or the display file will make an entry if user press some keys. The data queue is not alone used by display file, its also used by another batch program.

        is there any other way to change the dataqueue of a display file at run time for different sessions?

        Comment


        • #5
          Re: Multiple instance of one display file having different data queue

          I found a way to do it. I created the dataqueue in the qtemp library so each session will have its own dataqueue. i put the wait time to 0 in qrcvdtaq and put it in a loop. so inside this loop i can check both whether user gave any inputs or value in data area changed(if changed i will refresh screen) in a single program.

          Comment


          • #6
            Re: Multiple instance of one display file having different data queue

            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment

            Working...
            X