PDA

View Full Version : QSH & JAR



Guest.Visitor
11-26-2002, 06:07 AM
View the list of files in the jar: jar -tvf myfiles.jar Is the jar empty? Do the files myfile1.doc myfiles2.txt really exit in myfolder? Are you able to perform these commands interactively in QSH? Chris

jclemmons@tdsf.com
11-26-2002, 06:28 AM
hi Chris, thank you for responding ! I tried to view the jar file by doing the following: jar -tvf myfiles.jar Nothing is listed.. it just comes by to the prompt with no errors. I am doing this interactively yes. thank you, Julie

Guest.Visitor
11-26-2002, 11:44 AM
This worked for me interactively using the Integrated File System: qsh cmd('cd /tmp/;jar -cvf myfiles.jar a1.pdf a2.pdf') I will also put it in the Code session to make sure spacing is preserved. I cut & pasted your example to my command line and it didn't work without cmd('--stuff--') and needed a space between cd and the directory. I tried it with files in the /QDLS file system, and it failed with a bunch of Java errors, beginning with java.io.FileNotFoundException: Function not allowed. myfiles.jar I am at V5R1 with Cume C2134510. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae503e6/2')

jclemmons@tdsf.com
11-26-2002, 01:11 PM
Ken , Thank you for your help !!!!! I tried the same commands using the tmp directory on the IFS and it worked !! I wonder why it doesn't work with QDLS ?? that's ok though.. it works now. Any tips how I can properly use (qsh & jar )in a CLP ?? I have a CL program that builds these files on the 400, I then use the cpytoimpf to convert the files to .txt and puts it on the IFS. Now I want to zip the files. Thank you very much for your help :) Julie Clemmons

vin@planetchan.com
11-26-2002, 03:26 PM
Java does not work with QDLS and Jar is a java prog. So you can't zip QDLS files.

Guest.Visitor
11-26-2002, 05:02 PM
To use Qshell in a CL, just use the QSH command like I had in my example. I'll often set up the actual command in a CL variable, then run it with QSH. See example 1 below: recursively delete a directory and all subdirs. You can also monitor for exit codes; anything other than zero is bad. Do it by putting Example 2 after the QSH command. (The &HEX00 variable must be defined at the top of the program, of course.) One other thing: whatever subsystem you're running this in must allow extra active jobs. Let's say you're submitting it as a batch job to run in subsystem QBATCH. DSPSBSD QBATCH option 1 shows a "Maximum jobs in subsystem" value. If it is 1 or 2, then the zip will fail. This is because when you're actually doing the unzip, two more jobs appear in the subsystem from the job where QSH is running. The first is named QZSHSH, and the second is QP0ZSPWP. If you just do QSH on a command line to get into the Qshell environment, only QZSHSH will exist; QP0ZSPWP is spawned to do the work when you run a command. Anyway, in this example, QBATCH will need to have at least 3 for Maximum Jobs In Subsystem if you're going to run batch jobs that use Qshell commands. You can also speed things up by adding a Prestart job entry for the subsystem so the QP0ZSPWP job will already be there and won't go away after running the command. More info about that is at http://publib.boulder.ibm.com/iseries/v5r1/ic2924/info/rzahz/perform.htm and http://publib.boulder.ibm.com/iseries/v5r1/ic2924/info/rzahz/variable.htm I'm still figuring out all this Qshell stuff. I had to learn it in a BIG hurry a few months ago, when we needed to bundle a bunch of image files together & send them out as a Zip file. I use the ajar command instead of jar. Example 3 is the actual code I use to zip them. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae503e6/5')

jclemmons@tdsf.com
11-26-2002, 05:16 PM
Ken, Thank you very much for taking the time to share your knowledge and providing me with such detail information. I appreciate it very much !!! and everyone that helped me ! Thanks again for the assistance, I will read through the examples and try it out! :) Julie

jclemmons@tdsf.com
11-26-2002, 10:40 PM
Hi , I am trying to zip a file using QSH and Jar command. This is what I am doing: starting QSH session at the command line by typing QSH cd/qdls/myfolder;jar -cvf myfiles.jar myfile1.doc myfiles2.txt I do get some java messages... they don't look like error messages .. just messages that it's adding file, then it comes back to the $ sign. The jar file is created but it's empty, 0KB What am I doing wrong ?? I would appreciate the help. Eventually, I would like to do this in a CLP but I thought i try this first :) thank you very much, Julie