IBM i Access Client Solutions

 View Only
Expand all | Collapse all

Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

  • 1.  Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Mon August 26, 2024 12:27 PM

    Hello, 

    I have been attempting for about a week to get a data set from a csv or xlsx format to upload to a flat file the original data was downloaded from. The upload however only loads the data from the first column in the xlsx, or the first data set before the first comma in the csv. 

    I know I used to have this done successfully with Client Access for Windows, hoping someone has a way to do this with ACS.



    ------------------------------
    Amy Williams CISSP CISA PCIP
    Principal Security Consultant
    Fortra LLC
    ------------------------------



  • 2.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Mon August 26, 2024 10:47 PM
    Edited by Satid S Mon August 26, 2024 10:58 PM

    Dear Amy

    The word "flat DB file" that you used is confusing.  Are you actually mean an IBM i physical file object in an IBM i library object?    If you actually mean a "stream file" in an IBM i IFS folder, then Data Transfer feature of both Client Access for Windows and ACS is NOT designed to do this.  

    Assuming you mean an IBM i physical file, in uploading a PC file to a physical file, you need to specify a FDFX file (field definition file created and used by Client Access and ACS for upload operation - used to be FDF for Client Access) in conjunction with the upload.   If you have no such a FDFX file yet, you just do a download from your physical file to your PC first (make sure you select the option "Save client file description" and specify the file name as shown in the sample screen shot below) and a FDFX file is created by ACS for you at download (you delete the resulting downloaded CSV/XLSX file as you do not need it). Do this for each physical file you deal with and keep the FDFX file for all subsequent ACS upload.



    ------------------------------
    Satid S
    ------------------------------



  • 3.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Mon August 26, 2024 11:13 PM

    One more trick for you to create just the FDFX file without having to waste you time waiting for the actual download to happen and the target PC file created which you do not want it anyway.

    When doing the download for FDFX file only, you specify  WHERE 1=0 as shown below in the Data Option.    All details are in this Technote : Transferring Data From Excel using Access Client Solutions at https://www.ibm.com/support/pages/transferring-data-excel-using-access-client-solutions     

     



    ------------------------------
    Satid S
    ------------------------------



  • 4.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Tue August 27, 2024 07:59 AM

    Satid,

    Let me explain "flat file".  CRTPF FILE(MYLIB/MYFILE) RCDLEN(132)

    Think old RPG II where you used Input specs to define the fields.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 5.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Tue August 27, 2024 09:07 AM
    Edited by Satid S Tue August 27, 2024 09:26 AM

    Dear Robert

    Thanks to your explanation, this means a physical file with only one field.   No one in my part of the world uses the name flat file for so many years now.  

    Dear Amy

    If what Robert explained to me is actually what you meant by flat file, then it means you are trying to upload a multi-column CSV/XLSX PC file to that one-column physical file and this is not supported by ACS Data Transfer. 

    As Robert suggested, you should create a multi-column physical file that matches columns in your CVS/XLSX PC file and do the upload with ACS.  And this can be done (if you do not have DDS or SQL that creates the multi-column physical file) by instruction provided in this IBM training video: Move your data to DB2 for i using the ACS Database file wizard  at  https://mediacenter.ibm.com/media/Move+your+data+to+DB2+for+i+using+the+ACS+Database+file+wizard/1_soxf05yv     Then you use CPYF command to copy from the multi-column physical file to the flat file.  You should use the parameter FMTOPT(*NOCHK ) to achieve this.

    If this actually is not what you want, please explain more on what you want.



    ------------------------------
    Satid S
    ------------------------------



  • 6.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Tue August 27, 2024 09:18 AM

    You could wait for her response but I'd bet the farm on it.  This would explain this:

    <snip>

    The upload however only loads the data from the first column in the xlsx, or the first data set before the first comma in the csv. 

    </snip>

    She'd be better off creating a new intermediate file with actual columns/fields.  Or see if there is a way to say the "from" file has no delimiters.  



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 7.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Tue August 27, 2024 09:21 AM

    Another choice (as pleasant as fingernails on a chalkboard) is to upload the data as a stream file (ifs) and use CPYFRMSTMF (not CPYFRMIMPF as that would have the same issue).



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 8.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Tue August 27, 2024 08:07 AM

    Amy,

    If this flat file was created with something like CRTPF ... RCDLEN(265) and without DDS or DDL then you may be better off creating a new temporary file to upload that data in which DOES have columns/fields created with DDS or DDL.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------



  • 9.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Wed October 23, 2024 03:59 PM

    the problem with this is each excel is always different, depending on the User. We never know how many columns are in each excel.  Funny thing is that the old Client Access for Windows worked.



    ------------------------------
    Jason Breckner
    ------------------------------



  • 10.  RE: Upload CSV or XLSX file to Flat DB file using Data Transfer in ACS

    Posted Wed October 23, 2024 09:00 PM

    Dear Jason

    >>>> We never know how many columns are in each excel.  Funny thing is that the old Client Access for Windows worked. <<<<

    I'm certain that it needs additional effort to produce additional execution code for Client Access for Windows to work. It does not work right out of its basic features. This fact applies to IBM i ACS as well.   You should identify who did that tailoring code for your Client Access for Window and that person should be able to do a similar thing for IBM i ACS.   If you cannot identify who, then look at my 3rd post of this thread on how to do this but you need someone capable of coding the actions steps for your convenient use. 

     



    ------------------------------
    Satid S
    ------------------------------