× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi!

I am in a fight with 2 DSPF's that have been coded to handle both *DS3
and *DS4.

Basic program flow:

I call program OP3100R  that has a DSPF  that is coded as a SFL in *DS4
format.  This works great. 

I then select an option that calls another program: OP3102R.
This program utilizes a DSPF that is also a SFL  but is in a window and
is coded for both *DS3 and *DS4 format.  

In the *INZSR of OP3102R, I execute a procedure: GETCOMPANY that is in
service program SRVPROMPT.  
The DSPF for this procedure is also coded to use both *DS3 AND *DS4
Formats.  
This procedure also executes the procedure: GETSCNSIZ  in service
program SRVUTIL to determine which screen size to use.  It then presents
a subfile in a window.    

Up to now, everything is working great. The first screen from OPI3100R
is displayed in *DS4 and the procedure GETCOMPANY displays its window
subfile in *DS4.

I then select my enter from GETCOMPANY, close the DSPF and return to
OPI3102R.  
I then execute the GETSCNSIZ procedure again to determine the screen
size.  
But is returns the value for *DS3.  Has anyone experienced this behavior
and if so have you found a solution?

I have provided snippets of code for you:
OPI3102D:


A                                      DSPSIZ(24 80 *DS3
-
A                                             27 132 *DS4)

A                                      PRINT

A                                      CF01

A                                      CF02

A                                      CF03

A                                      CF04

A                                      CF05

A                                      CF06

A                                      CF07

A                                      CF08

A                                      CF09

A                                      CF10

A                                      CF11

A                                      CF12

A                                      CF13

A                                      CF14

A                                      CF15

A                                      CF16

A                                      CF17

A                                      CF18

A                                      CF19

A                                      CF20

A                                      CF21

A                                      CF22

A                                      CF23

A                                      CF24

A                                      PAGEDOWN

A*----------------------------------------------------------------------
---
A*

A          R DUMMY

A                                      ASSUME

A                                      KEEP

A                                  1  2' '

A*----------------------------------------------------------------------
---
A*

A          R WDWFORMAT

A  *DS3                                WINDOW(*DFT 18 67 *NOMSGLIN)

A  *DS4                                WINDOW(*DFT 18 67 *NOMSGLIN)

A  90                                  DSPMOD(*DS4)

A                                      WDWTITLE((*TEXT &WDWTITLE)
(*COLOR -
A                                      WHT) (*DSPATR HI RI))

A            WDWTITLE      22A  P

A*----------------------------------------------------------------------
---
A*

A          R SFLFMT01                  SFL

A            LHGRPNAM      10A  H

A            LHGRPDES      50A  H

A            LHCHOICES      1Y 0H

A*

A            LNSLCTN       63A  O  6  2

A            LNCHOICES      1Y 0H      SFLCHCCTL

A*

A*----------------------------------------------------------------------
---
A*

A          R CTLFMT01                  SFLCTL(SFLFMT01)

A  *DS3                                SFLPAG(0010)

A  *DS4                                SFLPAG(0010)

A  *DS3                                WINDOW(WDWFORMAT)

A  *DS4                                WINDOW(WDWFORMAT)

A  90                                  DSPMOD(*DS4)

A                                      SFLSIZ(&SCRSIZ1)

A                                      RTNCSRLOC(&SCRFMT &SCRFLD
&SCRPOS)
A                                      CSRLOC(@CSRLOCROW @CSRLOCCOL)

A                                      SFLCSRRRN(&@SFLCSRRRN)

A                                      SFLDSPCTL

A  30                                  SFLDSP

A  31                                  SFLCLR

A  31                                  SFLDLT

A  91                                  SFLEND(*MORE)

A                                      OVERLAY

A                                      SFLMLTCHC(&@PRFSLCTD *RSTCSR)

A            @SFLSCROLL     5S 0H      SFLSCROLL

A            @SFLRCDNBR     4S 0H      SFLRCDNBR

A            SCRSIZ1        5S 0P

A            @SFLCSRRRN     5S 0H

A            SCRFMT        10A  H

A            SCRFLD        10A  H                                   
A            SCRPOS         4S 0H                                   
A            @CSRLOCROW     3S 0H                                   
A            @CSRLOCCOL     3S 0H                                   
A            @PRFSLCTD      4Y 0H                                   
A                                  1  1'Cpy.:'                      
A                                      COLOR(WHT)                   
A            SCCPY          3S 0O  1  7                             
A                                  1 11'-'                          
A            SCCPYDES      25A  O  1 13                             
A            SCRPROG       23A  O  1 45                             
A                                  2  1'User:'                      
A                                      COLOR(WHT)                   
A            SCUSRNAM      10A  O  2  7                             
A                                  2 18'-'                          
A            SCUSRDES      48A  O  2 20                             
A                                  4 37'Position to:'               
A            SCRPSET       10A  B  4 50ENTFLDATR((*DSPATR RI))      
A                                      DSPATR(HI)                   
A                                      DSPATR(UL)                   
A                                  5  2'Group'

A                                      COLOR(WHT)

A                                  5 15'Description'

A                                      COLOR(WHT)

A*

A*----------------------------------------------------------------------
--- 
A*

A          R DSPFMT01

A  *DS3                                WINDOW(WDWFORMAT)

A  *DS4                                WINDOW(WDWFORMAT)

A  90                                  DSPMOD(*DS4)

A            PSHBTTN01      2Y 0B 17  2PSHBTNFLD

A                                      PSHBTNCHC(3 'E>xit' CF03)

A                                      PSHBTNCHC(09 'Se>lect Cpy' CF09)

A                                      PSHBTNCHC(10 'Cu>rsor' CF10)

A                                      PSHBTNCHC(12 '>Cancel' CF12)

A            SCMSG         65A  O 18  2COLOR(WHT)



RPG Program: OP3102R:

          H/TITLE OP3102R - Assign/Unassign Groups
     H BNDDIR('DLL')
     H ACTGRP('QILE')
     H OPTION(*SRCSTMT:*NODEBUGIO)
     H ALWNULL(*USRCTL)
     H DFTNAME(OP3102R)
    
     FOP3102D   CF   E             WORKSTN INFDS(SCRDS)
     F                                     SFILE(SFLFMT01:V_RRN1)
     FOPUSRGRPM1IF   E           K DISK
     FOPUSRGRPD1UF A E           K DISK
     FCPYMST    IF   E           K DISK
      
                              
             WRITE WDWFORMAT;
             WRITE DSPFMT01;
             EXFMT CTLFMT01;


       (A LOT OF CODE HAS BEEN REMOVED FOR THE PURPOSE OF THIS EMAIL)
             
           *INLR = *ON;
 
//'--------------------------------------------------------------------
       //'
       //' *INZSR - Initialization Subroutine
       //'-----------------------------------
           BEGSR   *INZSR;
       //' -----   -------
       
       //'
       //' Select a Company to Work With
       //'
           PO_Cpy = *ZEROS;
           PO_CpyDes = *BLANKS;
           V_KyCpy = SELECTCPY(PO_Cpy PO_CpyDes);
 

       //'
       //' Retrieve calling pgm Screen Size and set correct screen size
in OP3102D
       //'
           V_ScreenSize = GETSCNSIZ;
           SELECT;
             WHEN V_ScreenSize = '*DS3';
               *IN90 = *OFF;
             WHEN V_ScreenSize = '*DS4';
               *IN90 = *ON;
             OTHER;
               *IN90 = *OFF;
           ENDSL;
       
           WdwTitle = 'Assign/Unassign Groups';
           WRITE WDWFORMAT;
 

           ENDSR;
 

      /END-FREE
 


DSPF for SELECTCPY:


     A                                      DSPSIZ(24 80 *DS3
-
     A                                             27 132 *DS4)
     A                                      PRINT
     A                                      CF01
     A                                      CF02
     A                                      CF03
     A                                      CF04
     A                                      CF05
     A                                      CF06
     A                                      CF07
     A                                      CF08
     A                                      CF09
     A                                      CF10
     A                                      CF11
     A                                      CF12
     A                                      CF13
     A                                      CF14
     A                                      CF15
     A                                      CF16
     A                                      CF17
     A                                      CF18
     A                                      CF19
     A                                      CF20
     A                                      CF21
     A                                      CF22
     A                                      CF23
     A                                      CF24
     A                                      PAGEDOWN
 
A*----------------------------------------------------------------------
---
     A          R DUMMY
     A                                      ASSUME
     A                                      KEEP
     A                                  1  2' '
 
A*----------------------------------------------------------------------
---
     A*
     A* Select Company Window Format
     A*
     A          R CPYWDWFMT
     A  *DS3                                WINDOW(*DFT 19 35 *NOMSGLIN)
     A  *DS4                                WINDOW(*DFT 19 35 *NOMSGLIN)
     A  90                                  DSPMOD(*DS4)
     A                                      WDWBORDER((*COLOR WHT))
     A                                      WDWTITLE((*TEXT ' Select
Company ')-
     A                                       (*COLOR WHT) (*DSPATR RI)
*CENTER)
     A*
 
A*----------------------------------------------------------------------
---
     A*
     A* SELECT COMPANY Subfile
     A*
     A          R CPYSFL                    SFL
     A            LHCPY          3Y 0H
     A            LHDSC         25A  H
     A*
     A            LNCOMPANY     31   O  2  2
     A            LNCHOICE       1Y 0H      SFLCHCCTL
 
A*----------------------------------------------------------------------
---
     A*
     A* Select COMPANY Subfile Control
     A*
     A          R CPYCTL                    SFLCTL(CPYSFL)
     A  *DS3                                SFLPAG(0016)
     A  *DS4                                SFLPAG(0016)
     A  *DS3                                WINDOW(CPYWDWFMT)
     A  *DS4                                WINDOW(CPYWDWFMT)
     A  90                                  DSPMOD(*DS4)
     A                                      OVERLAY
     A                                      SFLCSRRRN(&CPYCSRRRN)
     A                                      RTNCSRLOC(&CPYRCDNAM
&CPYFLDNAM)
     A                                      CSRLOC(CPYROW     CPYCOL)
     A  30                                  SFLDSP
     A                                      SFLDSPCTL
     A  31                                  SFLDLT
     A  31                                  SFLCLR
     A  30                                  SFLEND(*MORE)
     A                                      SFLSIZ(&CPYSFLSIZ)
     A                                      SFLSNGCHC(*RSTCSR)
     A            CPYRCDNBR      4S 0H      SFLRCDNBR(CURSOR)
     A            CPYSCROLL      5S 0H      SFLSCROLL
     A            CPYRCDNAM     10A  H
     A            CPYFLDNAM     10A  H
     A            CPYROW         3S 0H
     A            CPYCOL         3S 0H
     A            CPYCSRRRN      5S 0H
     A            CPYSFLSIZ      5S 0P
     A            CPYPSHBTN      2Y 0B 19  2PSHBTNFLD
     A                                      PSHBTNCHC(12 'Cancel' CF12)



RPG Code for SELECTCPY:


     /TITLE SRVPROMPT - Prompt and Select Functions
    H NOMAIN
    H DFTNAME(SRVPROMPT)
    H OPTION(*SRCSTMT : *NODEBUGIO)
 
    FCPYMST    IF   E             DISK    USROPN
    FSRVPROMPTDCF   E             WORKSTN INFDS(SCRDS)
SFILE(CPYSFL:V_CPYRRN)
    F                                     USROPN
    '*
 
'*----------------------------------------------------------------------
---
    '* Prototypes
    '*
    D SelectCPY       PR             3S 0
    D  PI_Company                    3S 0
    D  PI_CpyDes                    25A
    '*
    '*
    '*
 
'*----------------------------------------------------------------------
---
    '* Global Data Structures
    '*
    D/COPY QRPGLESRC,PGMSDS
    D/COPY QRPGLESRC,DSPFDS
    D/COPY QRPGLESRC,DSPFATTRDS
    '*
 
'*----------------------------------------------------------------------
---
    '* Global Variables
    '*
    D V_CpyRRn        S              3S 0 INZ(*ZEROS)
    '*
 
'*----------------------------------------------------------------------
---
    '* Start of Procedure: SelectCPY
    '*
    P SelectCPY       B                   EXPORT
    '*
 
'*----------------------------------------------------------------------
---
    '* Procedure Interface
    '*
    D SelectCPY       PI             3S 0
    D  PI_Cpy                        3S 0
    D  PI_CpyDesc                   25A
    '*
 
'*----------------------------------------------------------------------
---
    '* Local Tables and Arrays
    '*
    '*
    '*
 
'*----------------------------------------------------------------------
---
    '* Local Standalone Variables
    '*
    D N_GotOne        S               N   INZ(*OFF)
    D N_ForceExit     S               N   INZ(*OFF)
    '*
    D V_RtrnCpy       S              3S 0 INZ(*ZEROS)
    D V_Size          S              4A   INZ(*BLANKS)
    '*
 
'*----------------------------------------------------------------------
---
    '*  Local Data Structures
    '*
    '*
 
'*----------------------------------------------------------------------
---
    '* Prototypes
    '*
     /COPY QRPGLESRC,GETSCNSIZ
    '*
 
'*----------------------------------------------------------------------
---
    '* NonExecutable
    '*
    '*
 
'*----------------------------------------------------------------------
---
     /FREE
 
/'----------------------------------------------------------------------
     /' Mainline
     //
     //
     //' Open Files
     //
          IF NOT %OPEN(CPYMST);
            OPEN CPYMST;
          ENDIF;
          IF NOT %OPEN(SRVPROMPTD);
            V_Size = GETSCNSIZ;
 

            SELECT;
              WHEN V_Size = '*DS3';
                *IN90 = *OFF;
              WHEN V_Size = '*DS4';
                *IN90 = *ON;
              OTHER;
                *IN90 = *OFF;
            ENDSL;
 

            OPEN SRVPROMPTD;
          ENDIF;
      //'
      //' Initialize Window Format
      //'
          WRITE CPYWDWFMT;
      //'
      //' Reset Subfile Processing Fields
      //'
          V_CpyRRn = *ZEROS;
          CpySflSiz = *ZEROS;
          CpyRcdNbr = 1;
      //'
      //' Initialize Subfile
      //'
          *IN30 = *OFF;
          *IN31 = *ON;
          WRITE CPYCTL;
          *IN31 = *OFF;
      //'
      //' Set File Pointer
      //'
         // SETLL *ZEROS CPYMST;
      //'
      //' Load Subfile Loop
      //'
          READ CPYMST;
            DOW NOT %EOF(CPYMST);
              IF %SCAN('DO NOT USE':CPADSC) = *ZEROS;
                IF %SCAN('AVAILABLE':CPADSC) = *ZEROS;
                  LhCpy = CPACPY;
                  LhDsc = CPADSC;
                  LnCompany = %CHAR(CPACPY) + '-' + %TRIM(CPADSC);
      //'
      //' If Input Parameter PI_Cpy is not ZEROS then indicate by
setting
      //' LNCHOICE field as selected for input Company
      //'
                  IF PI_Cpy <> *ZEROS AND LhCpy = PI_Cpy;
                    LnChoice = 1;
                  ELSE;
                    LnChoice = 0;
                  ENDIF;
 

                  V_CpyRRn = V_CpyRRn + 1;
                  WRITE CPYSFL;
                ENDIF;
              ENDIF;
 

              READ CPYMST;
            ENDDO;
      //'
      //' No Records Found
      //'
          IF V_CpyRRn = *ZEROS;
            LnCompany = 'NO RECORDS';
            LnChoice = 4;
            V_CpyRRn = 1;
            WRITE CPYSFL;
            N_ForceExit = *ON;
          ENDIF;
 

          *IN30 = *ON;
          CpySflSiz = V_CpyRRn;
      //'
      //' Main Processing Loop
      //'
          DOU FKey =  F12;
            WRITE CPYWDWFMT;
            EXFMT CPYCTL;
 

            IF N_ForceExit;
              FKey = F12;
            ENDIF;
 

            IF CpyCsrRRn <> *ZEROS AND CpyCsrRRn <= CpySflSiz;
              CpyRcdNbr = CpyCsrRRn;
            ELSE;
              CpyRcdNbr = CpyScroll;
            ENDIF;
 

            SELECT;
              WHEN FKey = F12;
 

              WHEN FKey = Enter;
                FOR V_CpyRRn = 1 BY 1 TO CpySflSiz;
                  CHAIN V_CpyRRn CPYSFL;
                  IF %FOUND(SRVPROMPTD);
                    IF LnChoice = 1;
                      V_RtrnCpy = LhCpy;
                      PI_CpyDes = LhCpyDes;
                      N_GotOne = *ON;
                      V_CpyRRN = CpySflSiz + 1;
                    ENDIF;
                  ENDIF;
                ENDFOR;
            ENDSL;
 

            IF N_GotOne;
              FKey = F12;
            ENDIF;
          ENDDO;
 

          CLOSE(E)  CPYMST;
          CLOSE(E)  SRVPROMPTD;
 

          RETURN V_RtrnCpy;
     /END-FREE
 
'*----------------------------------------------------------------------
---
    P SelectCPY       E
    '*
    '*  End of Procedure: Select Company
 
'*----------------------------------------------------------------------
---

   

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.