Zipping a report in CL

Tags:
Development
I have a 400 page report that I want to email out. This I can do, but it takes a bit of a while before the email is received. Is there a way to zip the report before emailing out?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Following this link http://homepage1.nifty.com/uzaemon/#download you’ll find a porting of compression library (zlib) for AS/400. This is a zip/unzip command line utility that you can use in your cl program. Hope may this help you. Ciao.

Discuss This Question: 8  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • jimhorn
    I know this may be long but -
    0 pointsBadges:
    report
  • jimhorn
    I know this may be long but - we use a combination of -coolspools- on the iseries winzip on a small pc server and febooti email on the pc server to turn spools to pdf's, zip them, rename them, email them and extract them on the remote pc. a small scheduled entry on the pc does the job.
    0 pointsBadges:
    report
  • Qpgmrs
    We use a .bat file and winzip 9.0 to zip, encrypt, and password protect the report. The .bat then submits a job on the iseries. The CL program then checks for the existance of the zip file. It either emails the zip file as an attachment or emails out an error message. Below is the batch file (note: this one sends out three reports). :START @echo off :INIT @echo. @echo Initializing the (clientname) Acquisition Report and the Rejection Report process... @echo. e: cd clientnameReportsACQ if exist Acq.zip del ACQ.zip if not exist Acq.csv goto :SBMJOB :ZIP @echo. @echo Zipping and encrypting file... @echo. c:progra~1winzipwzzip -a -password -ycAES256 ACQ.zip ACQ.csv if not exist ACQ.zip goto :ERROR1 e: cd clientnameReportsREJ1 if exist REJ1.zip del REJ1.zip if not exist REJ1.csv goto :SBMJOB :ZIP @echo. @echo Zipping and encrypting file... @echo. c:progra~1winzipwzzip -a -password -ycAES256 REJ1.zip REJ1.csv if not exist REJ1.zip goto :ERROR1 e: cd clientnameReportsREJ2 if exist REJ2.zip del REJ2.zip if not exist REJ2.csv goto :SBMJOB :ZIP @echo. @echo Zipping and encrypting file... @echo. c:progra~1winzipwzzip -a -password -ycAES256 REJ2.zip REJ2.csv if not exist REJ2.zip goto :ERROR1 :SBMJOB @echo. @echo Submitting job on As/400... rmtcmd "sbmjob job(ACQ_SEND) cmd(call Mylib/Myprogram) jobq(myjobq) logclpgm(*YES)" @echo. @echo The clientname ACQA Monthly Report process completed normally. goto :END :ERROR1 @echo An error occurred zipping the clientname ACQ Monthly Report. Please contact the Helpdesk. goto :END :END exit
    0 pointsBadges:
    report
  • Hypidia
    We use an GZIP tool on the iSeries. There are serveral GZIP tools available, some are freeware. So there is no need for PC server scripts etc., just some CL commands more in your Cl program. Sorry I do not remember where our tool is from.
    0 pointsBadges:
    report
  • Lriger
    You don't say if this is a one shot deal or a report that is done at regular or varying intervals. If the job is repeating what we need to know is: What platform are you using? What OPSYS is on the platform? Do you want a fully automated process? Do you want to email the re3port to one or many people? Could you FTP the report to a server for viewing by multiple people? My choice would be to write a perl program to determine if the report is there and complete, zip the report and then email/ftp the report where you want it to go. I would set up a cron job to routinely check for the file or actually a file complete indicator. Then start the run when the file complete indicator is there. This however would be on a Unix/Linux platform. If you are using a Windoz platform I would still use perl (free download) and easier to follow than bat syntax. Then find out if Windoz has a timed execution feature to detect when the file is there and kick off the process. lriger
    0 pointsBadges:
    report
  • Milloww
    If you want to avoid loading further utilities you can use QSHELL and JAVA on the AS/400 to do this. There are a few gotyous with the JAVA but it generally works. Also the jar command doesn't compress as tightly as other utilities but ... I have used this technique quite extensively. The file can be unzipped using any of the standard methods. Below is a snippit of code. /* Use QSHELL to zip the file */ CHGVAR &command ('cd' *BCAT &directory) CHGVAR &command (&command *BCAT ';' *BCAT + 'jar -cvfM' *BCAT + &zipfile *BCAT + &dbffile) STRQSH CMD(&command) /* Get rid of the file we just zipped up */ CHGVAR &object (&directory *TCAT &dbffile) RMVLNK OBJLNK(&object) /* Now move the zip file to QDLS so we can e-mail it */ CHGVAR &object (&directory *TCAT &zipfile) MOVE OBJ(&object) TODIR(&folder)
    0 pointsBadges:
    report
  • TheQuigs
    To zip the file, you can use built-in OS/400 support in the QShell. Here's a sample CL command: strqsh cmd('jar cfM zipped-file.zip spoolfile.prn') There was an article earlier this year on MCPRESSONLINE. Here's a link to the TechTip. If you follow the links at the bottom of the tip, they lead you to documentation of the Qshell and of the jar command.
    0 pointsBadges:
    report
  • CodeCutter
    pkzip (by pkware) for the iseries is another tool; i've used the pc version but no experience with the iseries version. http://www.pkware.com/products/enterprise/iseries/pkz/
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following