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

FTP a zip file via JCL in mainframes


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Wed Aug 07, 2013 11:09 pm
Reply with quote

Hi,

I tried to find this in the forum, about PKZIP and FTP that file to a shared drive, but i am not getting the below issue:

Here is my PKZIP jcl to zip the mainframe file:

Code:
//********************************************************************
//* THIS JOB WILL ZIP A MAINFRAME FLAT FILE                           
//********************************************************************
//*                                                                   
//ZIP01    EXEC PGM=PKZIP,REGION=2048K                               
//STEPLIB  DD DISP=SHR,DSN=PKZIP.LOAD                         
//INFILE DD DSN=GDG.JCL,DISP=SHR                             
//SYSPRINT DD SYSOUT=*                                               
//SYSOUT DD SYSOUT=*                                                 
//SYSIN DD *                                                         
 -ECHO                                                               
 -MEMORY_MODE(SMALL)                                                 
 -ARCHIVE(GDG.ZIP)                                           
 -DATA_TYPE(BINARY)                                                   
 -METHOD(MAXIMUM)                                                     
 -INDD(INFILE)                                                       
/*                                                                   
//*



The above job successfully zips my file GDG.JCL to GDG.zip.

Now i am not able to FTP this GDG.zip file. Can anyone please help me in this:

Code:
//P001     EXEC PGM=FTP,PARM='(EXIT',REGION=4096K                   
//INPUT    DD *                                                     
Mycompany name
User
password
ASCII                                                               
PUT 'GDG.JCL' \shrdata\wc\wcscan\GDG.zip                         
QUIT                                                                 
//OUTPUT   DD SYSOUT=*                                               
//SYSPRINT DD SYSOUT=* 


I know, there is some issue with the ASCII and BINARY. My PKZIP has created BINARY and i am sending in ASCII.
Can anyone please help on how to FTP this BINARY zip file.

Thanks.
Ravneet.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Aug 07, 2013 11:14 pm
Reply with quote

What are the error messages that you are getting?
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 Aug 07, 2013 11:17 pm
Reply with quote

Code:

//P001 EXEC PGM=FTP,PARM='(EXIT',REGION=4096K
//INPUT DD *
Mycompany name
User
password
ASCII
PUT 'GDG.JCL' \shrdata\wc\wcscan\GDG.zip
QUIT
//OUTPUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
1. "my company name" should be the IP address or DNS name for the server you are connecting to
2. ASCII should be BINARY -- ZIP files must be transferred as binary
3. I don't know how PKZIP works on the mainframe, but I suspect you want to transfer GDG.ZIP, not GDG.JCL
Back to top
View user's profile Send private message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Wed Aug 07, 2013 11:37 pm
Reply with quote

Thanks Bob.
I got it. It was a silly mistake i was making in my JCL, which you corrected in point 3.
I put GDG.JCL instead of GDG.ZIP in my jcl and it worked.
Below is the jcl that worked:

//P001 EXEC PGM=FTP,PARM='(EXIT',REGION=4096K
//INPUT DD *
DNS name
User
password
BINARY
PUT 'GDG.ZIP' \shrdata\wc\wcscan\GDG.zip
QUIT
//OUTPUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*

Thanks again !!!
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: Thu Aug 08, 2013 12:46 am
Reply with quote

Glad to hear you got it working, but I go by Robert -- never have been called "Bob" except by people who don't know better.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Aug 08, 2013 1:55 pm
Reply with quote

Quote:
people who don't know better
or with a death-wish? icon_smile.gif

chhabraravneet:
There was nothing wrong with the JCL - the error was in the FTP control cards (they are NOT JCL).
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
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 SH256/MD5 Checksum in Mainframes JCL JCL & VSAM 14
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