November 2

0 comments

How to restore *SAVF from within a ZIP in IBM i – “Yep, it really is that groovy!”

By NickLitten

November 2, 2016

IBM, powertoy, projex4i, software

So, I was trying to help out a buddy in the land of IBM i today. He was trying to install the most recent Beta of Projex4i IBM i Powertools on a clients IBM i Server. The problem he was facing was two fold (a) the connection he was using was very slow so trying to FTP 120+MB onto the machine was taking an age and (b) the FTP setup had blocked access to libraries on the box.

After some serious head scratching, I came up with a way of copying a compressed ZIP upto the IBM i System, and placing this nice small ZIP straight into the IFS. It makes perfect sense to transfer the smallest size possible and then extract (unzip) the file on the IBM i box itself, converting it to a regular *SAVF and then restoring the library. *BOOM*

I gotta write this down before I forget it:

Problem:

We actually have two problems here:

  1. I want to transfer a large library to an IBM i using minimum bandwidth.
  2. I can only use the IFS Windows shares

Solution:

So, lets start out by taking the latest version of IBMi Powertool Library from https://www.projex4i.com/download

This downloads a ZIP file called PROJEX4I_version.ZIP which contains a PC version of an IBM i *SAVF – for this example we are assuming its called PROJEXSHIP.SAVF

How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 1

The ZIP file contains a compressed LIB(PROJEXSHIP) – thus reducing the 127MB file to a mere 27MB. This screenshot shows these files in a windows folder on our local PC:

Projex4i_compressed. Png

We are going to do this:

  1. Copy the ZIP file into an IFS Folder on our IBM i Server
  2. Log into IBM i and (a) use IBM Java to UNZIP it (b) Use IBM FTP to concert the unzipped file into a *SAVF and (c) restore stuff from the save file.
  3. Easy peasy… lemon squeezy

So lets do it…

IBM i Command Line

Log into your IBM i Server and lets create an IFS folder to hold the ZIP file that we are about to send to the IBM i Server:

MD DIR('\projex4i-install') DTAAUT(*RWX) OBJAUT(*ALL)
How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 2

Now lets flick out into our Windows environment because we want to upload the ZIP file from our PC into the IBM i IFS

 

From Windows

COPY/PASTE the ZIP to the IFS folder on your IBM i Server from windows.

NOTE: You can also use IBM i Navigator to do this. As long as you end up with the ZIP file living in to the IFS Folder that you just created, its not really important how you do it.

How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 3
How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 4

In all the screen shot examples here my IBM i Server name is \\your-ibm-i-server\

IBM i Command Line

Log into your IBM i Server and lets use JAVA to unzip it locally:

cd '\projex4i-install'

How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 5

Now we are going to use JAVA to *unzip* our distribution file into the same folder:

STRQSH CMD('jar -xf projex4i.zip')
How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 6

now it an unzipped file and we can use the IBM i TP Server to extract it back into itself and also create a *SAVF along the way.

Check it unzipped OK

WRKLNK OBJ('/projex4i-install/*.*') OBJTYPE(*ALL)  DETAIL(*EXTENDED) DSPOPT(*ALL)
How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 7

now we gonna create a SAVE file for it

We are going to put this in a working library called LIB(PROJEXDST)

DLTLIB LIB(PROJEXDST)
/* just in case it exists then delete the old one first */

CRTLIB LIB(PROJEXDST) 
 TYPE(*TEST) 
 TEXT('New installation Library for Projex4i') 
 AUT(*ALL) 
How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 8

now it’s time for the saucy bit

Lets use FTP to extract from IFS and create a SAVE FILE

ftp IBM-i-Server
enter user/password
namefmt 1
bin 
put /projex4i-install/projex4i.file /qsys.lib/PROJEXDST.lib/projex4i.savf
How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 9

use QUIT to leave FTP mode

Should be all done – time to restore

Now lets check that the SAVF was created OK

dspsavf projexdst/projex4i

which should look like this:

How to restore *savf from within a zip in ibm i - "yep, it really is that groovy! " 10

That’s All Folks!

now go out and restore the lib

RSTLIB SAVLIB(PROJEXSHIP) 
 DEV(*SAVF) 
 SAVF(PROJEXDST/PROJEX4I) 
 RSTLIB(PROJEX4I)

now you need to just run PROJEX4I/@INSTALL

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Join the IBM i Community for FREE Presentations, Lessons, Hints and Tips

>