Link to home
Start Free TrialLog in
Avatar of pugmi16
pugmi16

asked on

VARPG Subfile Write

Hello I am just getting into VARPG to create Windows Based Screens and went out on the net to find examples of how to do a simple subfile example. Here is the code I am doing:

     H
     H*EXE
     H*NOMAIN
     FCUSTOMER  IF   E           K DISK    REMOTE  BLOCK(*YES)
      *********************************************************************
      *
      * Window . . : WIN1
      *
      * Part . . . : PSEXIT
      *
      * Event  . . : PRESS this button to exit the program
      *
      * Description:
      *
      *********************************************************************
      *
     C     PSEXIT        BEGACT    PRESS         WIN1
      /free
        *inlr = *on;
      /end-free
     C                   ENDACT
      *********************************************************************
      *
      * Window . . : WIN1
      *
      * Part . . . : CAN000000A
      *
      * Event  . . : CREATE a subfile from a physical file on the 400
      *
      * Description:
      *
      *********************************************************************
      *
     C     CAN000000A    BEGACT    CREATE        WIN1
      /free
        // Read the physical file on the iSeries
           Read CUSTOMER;
           Dow (not(%eof(CUSTOMER)));
        // Write the Subfile record
           DSC = BUDDSC;
           SKU = BUDSKU;
           CUS = BUDCUS;
           Write Subf1;
           Read  CUSTOMER;
           Enddo;
      /End-free

     C                   ENDACT

My issue is the Write Subf1 statement. When I comment it out the program compiles fine and when debuging I see it run through the CUSTOMER file putting the proper values into DSC, SKU and CUS. But when I uncomment out the Write Subf1 and build it... it says errors were found in the build so I look at the error list and nothing is there ( I have it so I view all errors including warnings). Also the part name under the subfile part properties is Subf1. When I change the statement to Subf1 to Subf1888888 it comes back with a warning that I didn't use Subf1 for input or output (Along with the eror that Subf1888888 is not defined which I did on purpose :) but found it interesting it atleast knows Subf1 is there. Am I suposed to install some PDF's for the subfile to work? Is there another way besides Write operator? (All examples on the net say it's that easy to just put write (Subfile Name) Help!! The Button and the subfile are all on one Canvas. Thanks for your help in advance.




Avatar of daveslater
daveslater
Flag of United States of America image

Hi
first I have never used this but since there is no other responce I will give you some one to bounce ideas off.

Normally on a subfile you have an indicator to display the subfile. Has this been set on?
There is also a subfile Relitive reconrd number that says whar record you are writing, I can not see that this has been set.

Have you created the DDS or does this system create it for you? Can you post it - from there we can try to see what needs to be set.

Dave
ASKER CERTIFIED SOLUTION
Avatar of Member_2_276102
Member_2_276102

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept tliotta comment as answer
 

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
daveslater
Page Editor