View previous topic :: View next topic
|
Author |
Message |
Smita Sebastian
New User
Joined: 30 May 2007 Posts: 7 Location: India
|
|
|
|
Hi -
We receive a pipe '|' delimited file from a vendor which is in the zipped format. My requirement is to FTP 'get' the zipped file and unzip the file in the next step. Can someone provide me with the jcl steps for this? Is there any additional steps that I need to include for related processing like for example a format conversion?
Thanks,
S |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Smita Sebastian
New User
Joined: 30 May 2007 Posts: 7 Location: India
|
|
|
|
Hi superk,
Thanks for ur quick reply. I have got the PKUNZIP step from the link that you have given me. Now I need the FTP step...Will the normal FTP work for a zipped file? The ftp'd file would be in ASCII format. Will the format change after the PKUNZIP step? If so do we need any more additional steps to make the file fit for processing?
As of now, my ftp is as follows -
xxx.yyy.com (EXIT
username
password
sendsite
ascii
cd
dir
LOCSITE LRECL=500 BLOCKSIZE=0
get x.DLM 'HLQ.XXXX.YYYY.ZZZZZ' (R
get y.DLM 'HLQ.UUUU.VVVV.WWWW' (R
dir
quit |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
First, a zipped file cannot be transferred in ASCII format. You must use binary (image) format to transfer a zipped file. Otherwise what you receive will not be usable or even readable.
Second, the data in the zipped file, assuming it is ASCII, will still be ASCII on the mainframe once unzipped. Since the mainframe is EBCDIC, you'll have to convert the data from ASCII to EBCDIC to make it readable. Look at ICONV in the Unix System Services manual for details (PAX and other Unix System Services commands can also handle the conversion).
Third, unless your mainframe site has purchased PKZIP or one of the other mainframe zip packages such as ZIP-390 or INFO-ZIP, you will find yourself unable to run them. Which leaves you with a zipped file on the mainframe that you cannot process. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Robert, for the purpose of this topic, I'm making the presumption, unless the O/P says otherwise, that they do have a licensed version of PKWARE's products. If so, then the zip file will be in ASCII format, and yes it must be transferred in binary mode. The PKUNZIP program will take care of the conversion of the data inside from ASCII to EBCDIC if needed. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Kevin: My response was based on O/P's statement that vendor is sending zipped file -- nothing was said indicating they've got something to unzip it on their mainframe. Presuming they've got PKUNZIP or INFO-ZIP or ZIP-390, then yes, format conversion can be done as part of the unzip.
Smita: looking at your FTP job, I'd probably transfer a zipped file to Unix System Services, unzip it, and then move the unzipped file to a z/OS file. And did you get the 500 LRECL from your zip program documentation? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Smita,
You may already know this, but if you want to "pull" the data from the remote to the mainframe, using a mainframe process, the remote system must be running an ftp service (rather than only an ftp client).
Many unix servers run an ftp service - most win-based machines do not (when you include all of the desk-top systems).
You may want to consider having the remote "push" file rather than your batch job trying to pull the file as the mainframe will almost always be "up" and the remote may not, which would cause your process to fail. |
|
Back to top |
|
|
Smita Sebastian
New User
Joined: 30 May 2007 Posts: 7 Location: India
|
|
|
|
Hi -
Thanks for all your resposnses. The vendor has agreed to place unzipped files in the folder. Hence the FTP step should do...
Thanks,
S |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Hence the FTP step should do... |
So long as the remote folders are available on a system that is actually running an ftp service. . . |
|
Back to top |
|
|
|