A Simple Guide to jar
October 23, 2002 Timothy Prickett Morgan
Hey, Ted:
I read with interest the Midrange Guru article, “FTP and Save Files, Yet Again“, and I have a question. Do you have a simple guide to using the Qshell jar utility, something simple enough for someone who knows nothing about Qshell?
|
— Jeff
Jar stands for Java Archive and is just another name for the zip format that has been around for years in the PC world. As far as I know, jar files and zip files are interchangeable. I’ve never had a problem using one when I supposedly needed the other.
Jar is made for stream files, which are common in UNIX and PC environments. I have not had good luck with jar and database files.
To get back to the original question that kicked off this topic, here’s how to transfer a save file from one iSeries to another using the jar utility.
- On the iSeries, create the save file on the source machine and load it using the appropriate save command.
-
Use the QSH command to start Qshell. Jar will not read the save file from a library, at least not on the V5R1 machine I used. A tech editor who worked on this tip tested under V4R3, and jar read the save file. Then he tested on a V5R2 machine and jar would not read the save file. Go figure.
If jar won’t read the save file on your machine, copy the save file to an IFS file. The following example copies a save file called PROTOS in library MYLIB to an IFS file called protos.savf.
cp /QSYS.LIB/MYLIB.LIB/PROTOS.FILE protos.savf
-
Use jar to compress the IFS file into a jar file.
jar cvf protos.jar protos.savf
The first argument of the jar command is a list of options. The c option creates the jar file. The v option (“verbose”) causes jar to write messages to the display as it works. I like the v option and usually include it. The f option tells jar that the name of the jar file follows in another argument. Pay attention to the f option–you’ll need it every time you run jar, and if you leave it off, jar sits there, waiting for input from the keyboard, until you finally realize what’s happened and cancel the command.
The options are followed by the jar file name (because the f option was specified). The last argument is the name of the file to be archived. You can list more files if you wish.
-
FTP the jar file to the IFS of the target iSeries box. Use a binary transfer (because the data is not text data) and specify namefmt 1 (because you are dealing with IFS files).
bin namefmt 1 put /home/mydir/protos.jar /home/somedir/protos.jar
You can see the contents of the jar file, on either system, by running the jar command with the t (table of contents) option.
jar tf protos.jar
-
Log into the target system. Create a save file, either from a CL command line or from Qshell.
From a command line:
CRTSAVF FILE(MYLIB/MYSAVF)
From Qshell:
system 'crtsavf file(mylib/mysavf)'
-
To extract the jar file into an IFS file, use the x option. Don’t forget the f option and the jar file name.
jar xf protos.jar
-
Copy the extracted IFS file to the save file.
cp protos.savf /QSYS.LIB/MYLIB.LIB/PROTOS.FILE
-
Exit Qshell to get back to a CL command line. Use the appropriate restore command to restore the saved objects to a library.
RSTOBJ OBJ(PROTOTYPES) SAVLIB(MYLIB) DEV(*SAVF) SAVF(PROTOS)
— Ted
Sponsored By WORKSRIGHT SOFTWARE |
CASS Certification
What is it? Why do you need it?
CASS stands for “Coding Accuracy Support System.” This is a test developed by the U.S. Postal Service to determine whether ZIP Code software can accurately assign ZIP Codes to mailing addresses. CASS-certified software is intended to improve the accuracy of carrier route, 5-digit ZIP, ZIP+4, and delivery point codes.
CASS certified means the software has passed the test. When you use CASS software to update and maintain your mailing file, then your mailing file becomes CASS certified. What does this mean to you?
CASS certification is the first step in qualifying for postage discounts. Look at the mail you receive at home and at work; you will see that a lot of it was mailed for less than the regular 37 cent rate.
Despite all the glitz and glamour of the Internet, email, and such, the wheels of America’s economy are lubricated by the ordinary envelope and the U.S. Postal Service.
If your company sends out a lot of mail, there is a good chance CASS certification can cut your postage expense. There are other steps you must perform to get these discounts, but CASS is the first step.
Your mail must be printed, sorted, and then packaged according to postal regulations. It takes some effort, but the potential savings make it worthwhile.
Exactly what happens when you process your mailing files with CASS software? The software breaks the address down into its individual elements: state, city, street name, and so forth. Then the information is compared to the national ZIP+4 database. If a match is found, the ZIP Code, ZIP+4, delivery point, and carrier route are assigned. Also the delivery line is standardized to comply with Postal Service preferences.
If an address can’t be matched, no action is taken. This has the positive effect of allowing you to identify addresses in your mailing files which possibly can’t be delivered, will be delayed in delivery, or at the very minimum need some minor correction to one of the address elements.
Using CASS certified software has many side benefits. You will be able to identify addresses that are potentially undeliverable. It has been estimated that as much as 30% of all advertising mail is never delivered.
That means the costs of postage, printing, paper, and overhead for undelivered mail are wasted. That means if you spend $100,000 on a direct mail campaign, as much as $30,000 could be completely wasted.
CASS software provides a number of intangible benefits. With CASS certification and bar coding there is a good likelihood that that your mail will be delivered sooner. If your invoices are delivered one day sooner, you may receive payment one day sooner.
If you CASS certify your mailing file, you can move on to the next step which is postal automation. This means applying a POSTNET bar code.
POSTNET is that little row of tall and short bars you see on your mail. POSTNET is a special bar code used by the Postal Service to allow automatic sorting machines to work.
It has been reported that bar code standard class (the old third class) mail gets delivered about as soon as first class, instead of the usual 2 or 3 weeks.
The bottom line is that using CASS software will help you keep your customers’ address information in much better shape than they would be otherwise. Your mail may be delivered sooner at less cost and that means more bottom-line dollars for your company.
If you would like more information about CASS and CASS software,
Are FedEx, United Parcel, and Airborne charges
Every bad address can result in a $5 to $10 charge. Even seemingly small addressing errors such as misspelled street names, or missing suite numbers can result in the same penalty as if the address were totally wrong.
Our PER/ZIP4 addressing matching software will match your addresses to the national ZIP+4 postal database. Based on the match PER/ZIP4, will update your addresses to postal standards. Our sophisticated address logic can add missing directionals, correct minor misspellings, and standardize the address format. If PER/ZIP4 can’t match the address, then you know that there is likely a serious error in the address that needs to be corrected.
PER/ZIP4 can be used in a batch mode to update an entire file or interactively to update individual address one at a time. We provide a search function so that you can search the national ZIP+4 database to verify a specific address.
Visit our Web site www.worksright.com for more information and to order a free, no-hassle, 30-day trial. Or call WorksRight Software, Inc., at 601-856-8337. |