Page 1 of 2

problem in displaying a temporory table with added data

PostPosted: Tue Jun 26, 2012 3:49 pm
by malli419
Hi everyone,

As per my requirement i displayed a panel (which is correction panel) with temporory table which contains several rows
Now user will corrects the rows on the panel, my duty is to validate the corrected rows in my master table and should display the non matching rows in another panel. So i created another temporory table for new panel and tried to add the rows which are not matching in my master table.when am trying to display the new panel it is giving only the last corrected row in all rows of new temporory table. Let me know if anyone know why it is happening?

Re: problem in displaying a temporory table with added data

PostPosted: Tue Jun 26, 2012 4:34 pm
by expat
Do you issue a TBTOP instruction before displaying the table ?

Re: problem in displaying a temporory table with added data

PostPosted: Tue Jun 26, 2012 4:43 pm
by malli419
Thanks expat,

Ya i codded TBTOP

let me expliain with example,
if three rows are added to that table it is displaying 3 rows but the fault is three rows containes same data which is present in last row. see if three rows are added to the table t should display like
1
2
3

but am getting
3
3
3

Re: problem in displaying a temporory table with added data

PostPosted: Tue Jun 26, 2012 7:20 pm
by Pedro
tried to add the rows

What does the trace show?

Show us your code.

Re: problem in displaying a temporory table with added data

PostPosted: Tue Jun 26, 2012 7:45 pm
by malli419
IF  PFKEY = 'PF05' THEN               
DO  WHILE (ZTDSELS > 0);               
    EXEC SQL                           
    DECLARE CURPART CURSOR FOR         
    SELECT PART_NO FROM PRDT.TBPART04 
        WHERE PART_NO = :PART_N;       
    EXEC SQL                           
    OPEN CURPART;                                                                             
    EXEC SQL                           
    FETCH CURPART                     
    INTO :VPARTNO;     
IF SQLCODE = 0 THEN                                         
   DO;                                                       
      MAT_L = MATL_DOC;                                     
      EXEC SQL                                               
      UPDATE EPPS.EOGPREC                                   
      SET I_PART = :PART_N                                   
      WHERE I_MATL_DOCU = :MAT_L;                           
      IF SQLCODE = 0                                         
           THEN DO;                                         
                   CALL ISPLINK('SETMSG ', 'INVNA700');     
                                                             
                   IF  (ZTDSELS = 1) THEN                   
                        ZTDSELS = 0;                         
                   ELSE                                     
                       DO;                                   
                         EXEC SQL COMMIT;                   
                         CALL ISPLINK('TBDISPL', 'INVNT700');
                       END;                                 
                      END;                           
                                                     
         END;                                       
   ELSE IF (SQLCODE = 100) THEN DO;                 
                                                     
 /************************************************/ 
           U_PART = PART_N;                         
           CALL ISPLINK ('TBADD', 'INVNT701');       
           RETURN_CODE = PLIRETV;                   
                                                     
           IF RETURN_CODE > 4                       
           THEN DO;                                 
           ERR_FOUND = '1'B;                         
           RETURN;                                   
           END;                                     
           EXEC SQL COMMIT;                         
 /***********************************************/   
             CNT = CNT + 1;                                 
                                                             
             IF  (ZTDSELS = 1) THEN                         
                  ZTDSELS = 0;                               
             ELSE                                           
                DO;                                         
                  EXEC SQL COMMIT;                           
                  CALL ISPLINK('TBDISPL', 'INVNT700');       
                END;                                         
           END;                                             
    EXEC SQL                                                 
    CLOSE CURPART;                                           
   END; /* DO WHILE END */                                   
   IF CNT > 0 THEN                                           
     DO;                                                     
        CALL ISPLINK ('VPUT ', '(PART)','PROFILE');         
        CALL ISPLINK('TBTOP', 'INVNT701');                   
      EXEC SQL COMMIT;                                 
      CALL ISPLINK('TBDISPL', 'INVNT701', 'INVNP701'); 
      CALL P6000_ROUTE_PARA;                           
   END;                                                 
 END P4000_VALIDATE_PARTNO; /* END OF VALIDATE PARA */ 
                                                                       


In the above code if sql code = 100 the non matching parts in my master table should be added to temporory table INVNT701

Thanks in advance

Re: problem in displaying a temporory table with added data

PostPosted: Tue Jun 26, 2012 8:10 pm
by Akatsukami
You did VDEFINE the dialog variables corresponding to the ISPF table columns in your PL/I program, yes?

Re: problem in displaying a temporory table with added data

PostPosted: Tue Jun 26, 2012 8:18 pm
by malli419
yes i defined them

Re: problem in displaying a temporory table with added data

PostPosted: Wed Jun 27, 2012 3:39 am
by Pedro
Does the panel )MODEL statement use the same variable names as the VDEFINE? Same as the TBCREATE?

Re: problem in displaying a temporory table with added data

PostPosted: Wed Jun 27, 2012 3:46 am
by Pedro
Of course, you know that your PLI program does not really do much of the stuff you mentioned in your original problem description.

Re: problem in displaying a temporory table with added data

PostPosted: Wed Jun 27, 2012 12:07 pm
by NicC
Your description is also confusing as you have made no distinction between ISPF tables and DB2 tables in your post. Is your temporary table the ISPF table (and only ISPF table)?