ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

CPYFRMIMPF command usage with excel sheet..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CPYFRMIMPF command usage with excel sheet..

    Hi Friends,

    I try to use CPYFRMIMPF command to copy an excel file in the IFS folders to the Flat file present in the library.

    The copy command is successful, but the datas are perfect junk data. ..

    I got a suggestion to use the CSV file instead of XLS format.
    But still the [problem persists.

    Please could anyone suggest the way to copy an excel file from the iFS folder to flat file without any delimiters and correct data.

    The command given by me is CPYFRMIMPF FROMSTMF('/home/t1.csv') TOFILE(QTEMP/TEST) RCDDLM(*CR)

    Also tried using RPLNULLVAL etc
    Last edited by prem; April 11, 2008, 05:17 AM.

  • #2
    Re: CPYFRMIMPF command usage with excel sheet..

    Just what in God's wonderful world are you trying to do?

    The .xls is in ascii while the iseries is in EBCDIC

    they are in differenct languages and they dont really even want to
    wave at each other on the street!

    please first explain what you are doing.

    thanks
    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: CPYFRMIMPF command usage with excel sheet..

      not only is the xls an ascii file. it's very complex file. the xls file has tons of hidden data for formatting, data storage, etc. not just the cell data. you won't be able to use CPYFRMIMPF or CPYFRMSTMF. you'll have to use another method, Scott Klement has a service program in RPG that uses the Apache POI java kit you should be able to download it from SystemiNetwork (search for HSSF) or you could use use java to dump the data, or use Client Access's plugin to export the data.
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #4
        Re: CPYFRMIMPF command usage with excel sheet..

        Hi,

        Thanks for the reply and helping me to understand the difficulties in XLS files.

        But what about transferring the CSV files in IFS folders to flat files in AS400. The CPYFRMIMPF command fails for the above mentioned syntax and reasons.. ???

        Could you please suggest any simple ways..

        Comment


        • #5
          Re: CPYFRMIMPF command usage with excel sheet..

          Try if this works
          Code:
          CPYFRMIMPF FROMSTMF('/Fldr1/File1.CSV') TOFILE(Lib1/FILE3) MBROPT
          (*REPLACE) RCDDLM(*CRLF) DTAFMT(*FIXED) FLDDFNFILE(Lib1/FILE4)
          Where File4 would be field defenition file for the data in File1.Csv
          Regards,
          KR

          Comment

          Working...
          X