Power

 View Only
Expand all | Collapse all

TXT display error when unzipping a ZIP file generated in the IFS

  • 1.  TXT display error when unzipping a ZIP file generated in the IFS

    Posted Tue November 26, 2024 11:56 AM

    Hello, Good morning!!!!.-

    I developed a process in cobol that does the following:

    1 - Send a file from the spool, directly to the IFS (without going through an intermediate PF file)

    CPYSPLF FILE(GLIMPREDI4) TOFILE(*TOSTMF) JOB(969000/user/QPADEV0046) TOSTMF('/FileRepository/SSIS/487/APP/output/BOLETIN.TXT') WSCST(*none) STMFOPT(*REPLACE)

    and depending on the WSCST parameter, it generates a TXT or a PDF

    2 - I verified the size of the file that was generated in the IFS, if it exceeds 3MB I zip the file (with a CL we execute the command through the QSHELL).

    JAR cvfM /FileRepository/SSIS/487/APP/output/BOLETIN.TXT.ZIP
    /FileRepository/SSIS/487/APP/output/BOLETIN.TXT

    3 - Finally, the process sends an email with the attached file (.TXT/.PDF or ZIP), as long as the file size does not exceed 3MB.-

    All development is done in cobol for AS400 (IBM i 7.3).-

    The problem I have is that when I unzip the file on a Windows PC, it brings me "garbage".

    I have other processes that send emails with attached ZIP files (source TXT file) and when I unzip them they are read correctly.-

    At first I thought it was the CCSID of the file that was different from that of the ZIP, but in the cases where they are read correctly, the CCSIDs are different.-

    Can someone guide me on where to look???



    ------------------------------
    Agustín Allende Gasparo
    ------------------------------


  • 2.  RE: TXT display error when unzipping a ZIP file generated in the IFS

    Posted Wed November 27, 2024 08:49 AM

    If you have a text file in the IFS that is EBCDIC (as this apparently is) you can convert it to the PC Latin-2 character set.

    The command I'll show you here depends your EBCDIC character set, we use 037 ... you may be using another character set for Spanish, so subsitute your number for IBM037 in this command:

    /usr/bin/iconv -f IBM037 -t ISO8859-2 myfile.txt > myconvertedfile.txt



    ------------------------------
    Jack Woehr
    Senior Consultant
    Seiden Group LLC
    Beulah CO
    3038478442
    ------------------------------