IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL required to FTP a zipped file to my z/os and unzip file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Smita Sebastian

New User


Joined: 30 May 2007
Posts: 7
Location: India

PostPosted: Wed Jul 02, 2008 2:42 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jul 02, 2008 2:50 pm
Reply with quote

See this previous topic.
Back to top
View user's profile Send private message
Smita Sebastian

New User


Joined: 30 May 2007
Posts: 7
Location: India

PostPosted: Wed Jul 02, 2008 2:59 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 02, 2008 3:11 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jul 02, 2008 3:21 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 02, 2008 5:19 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 02, 2008 10:32 pm
Reply with quote

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
View user's profile Send private message
Smita Sebastian

New User


Joined: 30 May 2007
Posts: 7
Location: India

PostPosted: Tue Jul 08, 2008 11:14 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 08, 2008 1:02 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 6
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top