Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

PKZIP to Zip the dataset and FTP it

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
nallaperumal

New User


Joined: 19 Nov 2007
Posts: 23
Location: Chennai

PostPosted: Fri Apr 29, 2011 6:14 am    Post subject: PKZIP to Zip the dataset and FTP it
Reply with quote

My Requirement is need to Zip the dataset and FTP it. Using PKZIP utility I have Zipped the dataset and FTP'd it. But I'm not able to view the content of the File.

Can someone help me to view the content of the Zipped Mainframe PS?
Back to top
View user's profile Send private message

superk

Moderator Team Head


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

PostPosted: Fri Apr 29, 2011 6:22 am    Post subject: Reply to: PKZIP Help
Reply with quote

Please post:

- the output messages from the PKZIP program.
- the output messages from your FTP process.
- the beginning of the zipped dataset (on the mainframe) in hex.
- the beginning of the zipped file (on the other server) in hex also.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Apr 29, 2011 6:43 am    Post subject:
Reply with quote

Also post the FTP commands (but not the IP address or server name, user id or password) you used.
Back to top
View user's profile Send private message
nallaperumal

New User


Joined: 19 Nov 2007
Posts: 23
Location: Chennai

PostPosted: Fri Apr 29, 2011 7:00 am    Post subject: PKZIP Help
Reply with quote

Please find the parameters used for zipping


-ECHO
-MEMORY_MODEL(SMALL)
-ARCHOUTDD(OUTFILE)
-METHOD(MAXIMUM)
-NOPATH
-PATH(N)
-ZIPPED_DSN(XXXX.XXXXX.XXXXXXX.CSV.D0425,YYYY.CSV)
-INFILE(INFILE)
ZPAM030I OUTPUT Archive opened: XXXX.XXXXX.XXXXX.D1000.CSV
ZPAM253I ADDED File XXXXX.XXXXX.XXXXXX.CSV.D1000
ZPAM254I as D1000
ZPAM255I (DEFLATED 97%/97%) DATA SIZE 350,000; ZIP SIZE 11,763
ZPAM140I FILES: ADDED EXCLUDED BYPASSED IN ERROR COPIED
ZPAM140I 1 0 0 0 0
ZPMT002I PKZIP processing complete. RC=00000000 0(Dec)

Let me know if you need more details
Back to top
View user's profile Send private message
nallaperumal

New User


Joined: 19 Nov 2007
Posts: 23
Location: Chennai

PostPosted: Fri Apr 29, 2011 7:11 am    Post subject: PKZIP Help
Reply with quote

I have FTP thru option 6 in the mainframe so i dont have message


Begining of the message in Mainframe - 540010000097
0B344020801B (Hex Values )

Begining of the message in txt file - &.ìï  â j#¦žÅ®j¡3 ª - Junk values
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Apr 29, 2011 9:29 am    Post subject: Reply to: PKZIP Help
Reply with quote

So all we really know is that the PKZIP program worked properly. I don't understand what you mean by your statement "I have FTP thru option 6 in the mainframe so i dont have message". An FTP initiated from the mainframe would have messages like:

Code:

EZY2640I Using 'TCPIP.FTP.DATA' for local site configuration parameters.
EZA1450I IBM FTP CS V1R6
EZA1554I Connecting to: xxx.xx.xxx port: 21.
EZA1701I >>> USER superk
331 User name okay, need password.
EZA1701I >>> PASS
230 User logged in, proceed.
EZA1460I Command:
sendsite
EZA1611I Usage of SITE command with PUT is OFF
EZA1460I Command:
binary
EZA1701I >>> TYPE I
200 Type set to I.
EZA1460I Command:
put 'the.dataset.zip' superk.zip
EZA1701I >>> STOR superk.zip
150 Opening BINARY mode data connection for superk.zip.
226 Transfer complete.
EZA1617I ...
EZA1460I Command:
qui
EZA1701I >>> QUIT


What I really wanted to see was:

the dataset:
Code:

&.        j#
540010000097
0B344020801B


the downloaded file:

Code:

00000000  50 4B 03 04 14 00 02 00-08 00 91 7B 00 00 00 00  PK.........{....


They should both be exactly the same, and you can see that hex '504B' value that is 'PK' in ASCII.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Apr 29, 2011 2:57 pm    Post subject:
Reply with quote

I echo Kevin's comment -- what you say about the FTP makes absolutely no sense. If you did the FTP wrong (text instead of binary), the ZIP file would not correct on the other machine -- no matter that it is perfect on the mainframe.
Back to top
View user's profile Send private message
nallaperumal

New User


Joined: 19 Nov 2007
Posts: 23
Location: Chennai

PostPosted: Fri Apr 29, 2011 6:56 pm    Post subject: PKZIP Help
Reply with quote

I am sorry if i confused,
My problem here is after FTP ing i need to see the content of the txt or csv without HEX values. I mean original values.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Apr 29, 2011 7:10 pm    Post subject: Reply to: PKZIP Help
Reply with quote

I don't like to state the obvious, but you do know that you have to unzip the file before it can be used, right?
Back to top
View user's profile Send private message
nallaperumal

New User


Joined: 19 Nov 2007
Posts: 23
Location: Chennai

PostPosted: Fri Apr 29, 2011 7:16 pm    Post subject: PKZIP Help
Reply with quote

My requirement is I need to ZIP the Mainframe file need to transfer to third party vendor as a CSV file. He/she needs to view the CSV file without Hex values that is the objective.
Again i am sorry for misleading you with my question
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Apr 29, 2011 7:20 pm    Post subject:
Reply with quote

And what are you using to convert the EBCDIC data on the mainframe to ASCII before doing the zip? You ARE aware, I hope, that the mainframe uses EBCDIC natively whereas Unix and PC machines use ASCII natively -- thereby making it impossible to just zip a file, transfer the zip file from one platform to another, unzip it, and use the data? An EBCDIC to ASCII translation must occur somewhere along the way, or the data will not be usable on the Unix / PC platform.
Back to top
View user's profile Send private message
nallaperumal

New User


Joined: 19 Nov 2007
Posts: 23
Location: Chennai

PostPosted: Fri Apr 29, 2011 7:40 pm    Post subject: PKZIP Help
Reply with quote

Ok, If i Zipped the Mainframe file, you meant to say i can able to view the original content of the file only after UNZIP ing correct. Am i right.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Apr 29, 2011 7:45 pm    Post subject: Reply to: PKZIP Help
Reply with quote

The PKZIP program deals with the EBCDIC-ASCII conversion when it's necessary, based on the input parameters (I didn't even look to see if it was specified in the PKZIP input example shown) so it probably needs to be included.

nallaperumal, it's not as if we know what your third-party wants. CSV means comma-seperated-values, which could mean EBCDIC or could mean ASCII.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Apr 29, 2011 7:50 pm    Post subject:
Reply with quote

Quote:
Ok, If i Zipped the Mainframe file, you meant to say i can able to view the original content of the file only after UNZIP ing correct. Am i right.
This is PARTIALLY correct. If you transfer the ZIP file from a mainframe to a Unix or PC platform, the unzipped file may -- or may not -- be viewable on the Unix or PC system. If there was no conversion done (by PKZIP or you) from EBCDIC to ASCII, then the data in the unzipped file on the Unix or PC platform will not be readable. For example, EBCDIC uses X'40' as a space character while ASCII uses X'20'. If not translated, a Unix or PC machine will NOT understand X'40' to be a space and the entire file will look like garbage (even though it is not).
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Fri Apr 29, 2011 7:52 pm    Post subject: Reply to: PKZIP Help
Reply with quote

This is from the product manual, and might be relevant:

Quote:

Data files are held within a ZIP Archive in either text or binary format. Both formats are supported by PKZIP® compatible products on other platforms, however, some restrictions apply to cross platform us-age of the data, for example, workstation-based applications may not be able to process EBCDIC-based data that is commonly produced by S390 platforms.

Text data is represented by one of two character sets: EBCDIC or ASCII, in which individual alphanu-meric characters are assigned an internal numeric code within the range of 0-255 (hexadecimal 00-FF). Although most of the same characters, for example, A-Z, a-z, 0-9 are contained in the EBCDIC and ASCII character sets, different code assignments are used for each. To preserve cross-platform com-patibility of files containing only text characters, the –DATA_TYPE(TEXT) command should be used. This will direct PKZIP for zSeries to translate EBCDIC characters into the ASCII character set (which is the standard set used by PKZIP® compatible products).

The –DATA_TYPE(BINARY) command is used to direct PKZIP for zSeries to bypass EBCDIC to ASCII character translation. This feature is useful when the file contains non-text data (Warning: Binary fields may generate what appear to be record delimited characters). Therefore, –TEXT should not be used if binary data is present. (Note that a custom TRANSLATETABLE_DATA table can be built to change control characters (X’0D’ + ‘25’ EBCDIC) to blanks) (such as graphics or internal numeric representa-tions, for example, packed, or binary numeric data), or if text-based data is to be extracted only to other EBCDIC based platforms.

All data within a file is treated the same during ZIP processing in accordance with the –DATA_TYPE(TEXT) and –DATA_TYPE(BINARY) commands. Care should be taken when zipping files that may contain both text and binary data. Use of the –DATA_TYPE(TEXT) command when binary data exists within the file will produce unpredictable results for fields containing binary data.

–DATA_TYPE(BINARY) should be used to preserve data integrity; however, this means that text data will not be translated into the ASCII format by UNZIP processing in a cross platform environment.

In the context of ZIP Archives, a “text file” is one that is stored in the ASCII format. A text file contains records of data, each separated by a delimiter to signify the end of the record.

PKZIP for zSeries uses the default delimiter CR-LF (x’0D0A’) at the end of each text record. You may choose to use a different delimiter by using the –DATA_DELIMITER command (or other characters as specified in the command set). At the end of each ZIP’d file is a file terminator. The default file terminator for PKZIP for zSeries is Ctrl -Z (x’1A’). This file terminator can be changed by using the –FILE_TERMINATOR command.

Note: The last record will have the data delimiter followed by the file terminator.

If it is desired that the ZIPPED file contain no data delimiters, you may specify –CRLF(N) or –DATA_DELIMITER(). If CR-LF is specified on ZIP, but –CRLF(N) is specified on UNZIP, then PKZIP for zSeries will treat the x'0D0A' as data characters, and they will be translated into the EBCDIC equivalent and be imbedded in the output file. Although it is possible for fixed length records to be properly aligned in an output file without CR-LF (by using input and output files with identical record lengths), care must be taken when using –CRLF(N) because –DATA_DELIMITER is the only explicit mechanism available to determine record lengths for text files.
At the time of UNZIP file extraction, PKZIP for zSeries will change text data from ASCII to EBCDIC by using a translation table.

PKZIP for zSeries extracts text records stored in the ZIP Archive by examining the data for record de-limiter and file terminator indicators. Using these indicators, PKZIP for zSeries aligns records in accor-dance with the target file attributes.
Back to top
View user's profile Send private message
nallaperumal

New User


Joined: 19 Nov 2007
Posts: 23
Location: Chennai

PostPosted: Thu May 05, 2011 9:03 pm    Post subject: PKZIP Help
Reply with quote

Thanks all it worked fine.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri May 06, 2011 2:50 pm    Post subject: Re: PKZIP Help
Reply with quote

nallaperumal wrote:
Thanks all it worked fine.
Well, what exactly was the final solution - could you please share that with us?
Back to top
View user's profile Send private message
KevinM

New User


Joined: 14 Dec 2006
Posts: 1
Location: Pennsylvania

PostPosted: Tue Jun 14, 2011 7:11 pm    Post subject:
Reply with quote

nallaperumal or anyone wishing direct support for the PKZIP product, PKWARE has an online support form that can be used to engage the companies support staff. If the above posts haven't completely answered your question or if you have additional questions, I'm sure you can find further assistance there.

http://www.pkware.com/support/zos

Thanks,

Kevin
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm
No new posts FTOPEN TEMP is failing due to dataset... mbenaud TSO/ISPF 7 Thu Jul 28, 2016 4:28 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us