EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Variable length record write

    Posted 03/25/15 04:57 AM

     

    Hello, 

    My customer is migrating its VAGen to  RBD  9.1.1

    In VAGen when writing out  variable length record,  there is no length field in output file.   In RBD there is extra length filed 

    produced in output file which is not what customer wants.  

    Is this product defect or usage error ? 

     

    The source is below 

    <RecordFR901T_WK typebasicRecord

      3 I int;

    end

     

    RecordFRVSF typeserialRecord

      {fileName = "FRVSF",

       lengthItem = I

      }

      3 VAGen_STRING char(80) ;

        4 STRING_H hex(160) ;

    end

     

    ///// program

    FRVSF.resourceAssociation = "D:\\TEMP\\output.TXT";

    setFRVSF empty;   

    FRVSF.VAGen_STRING= "AAAAA";

    FR901T_WK.I = strLib.byteLen(FRVSF.VAGen_STRING);

    addFRVSF ;

     

    setFRVSF empty;   

    FRVSF.VAGen_STRING= "BBB ";

    FR901T_WK.I = strLib.byteLen(FRVSF.VAGen_STRING);

    addFRVSF ;

     

    setFRVSF empty;   

    FRVSF.STRING_H = "0D0A";

    FR901T_WK.I = strLib.byteLen(FRVSF.VAGen_STRING);

    addFRVSF ;

     

    setFRVSF empty;   

    FRVSF.VAGen_STRING= "CCCCCCCCCC ";

    I = strLib.byteLen(FRVSF.VAGen_STRING);

    addFRVSF ;

    rununit.properties

    vgj.ra.frvsf.systemName=frvsf
    vgj.ra.frvsf.fileType=seqws
    vgj.ra.frvsf.replace=0
    vgj.ra.frvsf.conversionTable=
    vgj.ra.frvsf.text=1
    vgj.ra.frvsf.formFeedOnClose=1
     
    vgj.ra.frvsf.text=0

                                

    >

    dwkey


  • 2.  Re: Variable length record write

    Posted 03/25/15 03:15 PM

    Hi Chao,

    By his example I could see that you are recording a local file (windows), so you see no need to variable record as a VSAM file.

    Try to use definition below:

    RecordFRVSF typeserialRecord

      {fileName = "FRVSF"}

      3 VAGen_STRING STRING;

    end

    and create a Resource Association File and option TEXT, looks this link

    http://www-01.ibm.com/support/knowledgecenter/SSMQ79_9.1.1/com.ibm.egl.gg.doc/topics/gegl_core_associationelements.html

    Regards,

    Hsieh

     
    Hsieh


  • 3.  Re: Variable length record write

    Posted 03/26/15 03:10 AM

    Hi Hsieh,

    I tried your suggestion to change the type from char to string,  but the editor returns the error message :  

    IWN.VAL.4004.e 7/18 string is not a valid type for an item in a structured record or DataTable

     

    Record FRVSF type SerialRecord  {fileName = "FRVSF"}  3 VAGen_STRING STRING; end

     

    dwkey


  • 4.  Re: Variable length record write

    Posted 03/26/15 07:02 AM

    Sorry. Chao.

    I forgot. the string type does not support structure record and serialRecord type is to VSAM file.

    Looks this sample:

    package sample;
     
    record FRVSF type CSVRecord{fileName = "FRVSF"}
        VAGen_STRING string;
    end
     
    program sample type BasicProgram
     
        FRVSF FRVSF;
     
        function main()
            FRVSF.resourceAssociation = "C:\\TEMP\\output.TXT";
            set FRVSF empty;
            FRVSF.VAGen_STRING = "AAAAA";
            add FRVSF;
            FRVSF.VAGen_STRING = "BBB ";
            add FRVSF;
            FRVSF.VAGen_STRING = "CCCCCCCCCC ";
            add FRVSF;
        end
    end

    Create a Ressource Association File option

    </ResourceAssociations>
    <ResourceAssociations name="RessourceAssocFile">
    <association fileName="FRVSF">
    <win>
    <seqws text="YES"/>
    </win>
    </association>
    </ResourceAssociations>

    and put in your build option.

    I ran it in debug and the result was:

    AAAAA
    BBB 
    CCCCCCCCCC 

     

    Hsieh


  • 5.  Re: Variable length record write

    Posted 03/30/15 09:04 AM

    Hsieh,

    Thanks for the example. 

     

    L.H.,

    Did this answer the question?  I know the "string" data type was not supported in VAGen, so it this means it is a code change when going to EGL.   If the question is not answered, then what was the target language in VAGen (C++, Java, or COBOL)?  

    take care.

    Mark

    markevans


  • 6.  Re: Variable length record write

    Posted 04/02/15 03:48 AM

     

    Hsieh,  

        Thanks for your sharing.  

        The CSVrecord   will cause each record in new line, but customer designs to append one by one until they put new line

    control code to force new line output.  

    Mark,

    C++  was the target language in VAGen.    

     

    dwkey


  • 7.  Re: Variable length record write

    Posted 04/02/15 08:28 AM

    Hi Chao,

    I do not know what the ascii code for new line.

    My suggestion is to do the string concatenation to fill the complete line of recording an output record.

    Hsieh

    Hsieh