View previous topic :: View next topic
|
Author |
Message |
Kumar shobhit
New User
Joined: 29 May 2007 Posts: 14 Location: bangalore
|
|
|
|
Hi All,
I have FTPed a zip file to my Z/OS system and have extracted it using PKZIP, the output file is pipe delimited record format is 'VB' . I want to split the data such that each record must begin with new line. The Data is in UTF -8 format and end of records is denoted by '0D0A'. Can anybody suggest me how to implement it?. do PKZIP have some options or ICETOOL etc.
Note :For any futher clarification pls feel free to contact me. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Kumar shobhit wrote: |
I have FTPed a zip file to my Z/OS system ...
|
OK, got you so far, providing you've done this part correctly.
Kumar shobhit wrote: |
... and have extracted it using PKZIP ...
|
OK, still got you. It would be nice if you could post your PKUNZIP JCL and control cards for reference purposes.
Kumar shobhit wrote: |
... the output file is pipe delimited record format is 'VB' ...
|
Got you on the record format being VB part. You lost me when you refer to the data as being "pipe delimited".
Kumar shobhit wrote: |
... I want to split the data such that each record must begin with new line ...
|
If PKUNZIP was done correctly, it should.
Kumar shobhit wrote: |
... end of records is denoted by '0D0A' ...
|
That's true in ASCII. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Please post a few of the unzipped records in hex (you can turn HEX ON when you browse the dataset).
By pipe-delimited you mean your original looks like data1|data2|data3|data. . . etc . . cr/lf? |
|
Back to top |
|
|
Kumar shobhit
New User
Joined: 29 May 2007 Posts: 14 Location: bangalore
|
|
|
|
Hi All,
Thanks for the reply. Iam sending thi details, pls have a look . PLs feel free if you all need any further information.
JCL used to unzip file.
Code: |
//STEP120 EXEC PGM=PKUNZIP,REGION=8M
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
-ARCHIVE_DSNAME(GRMIW9.PROD.IBMBE.ZIP)
-UNZIPPED_DSN(,GRMIW9.TEST1.AUG24.)
-OUTFILE_OVERWRITE(Y)
-OUTFILE_DSNTYPE(SEQ)
-OUTFILE_LRECL(1069)
-OUTFILE_RECFM(FB)
-OUTFILE_SPACE_MULTIVOL=Y
-OUTFILE_UNIT(SYSDA)
-OUTFILE_SPACE_PRIMARY(2000)
-OUTFILE_SPACE_SECONDARY(2000)
-DATA_TYPE(BINARY)
-CRLF(Y)
-DATA_DELIMETER(CRLF)
/*
|
UNZIP FILE (HEX ON)
540010000038136F905D00D400000044444326778FDAA46AE91FB5F1B14B975842A07516F5E618F
0B3440208094073142FE002F80A00092D253E336CD9EEBE89DB05441CA155BB6AAB1C07F2B967C9
------------------------------------------------------------------------------
üÎ..ÿ6yÔù.»V4FÛbû.V£û._Õ¼ûîøÛtÓr.Á¶.%¿.íWq÷ß`gXÜ.¼9$±XP¸ýÛF¸ù3øβ¬.V.¶'¹Î:XRÃ>Ï
D723DFAED18EFCF8D3EBD06EBD57FAE906B36A25E9E578EF1BF58ED98FC9DF77E53E0B7D77ED667
C69FF68BD6B546B2BB51B7DF7B60B3E9C56BCBC56819977CD79BF77DDB6DD306AF75D6DA6A796E7
------------------------------------------------------------------------------
ų.V .õX.÷.¤¤VX;þ.Ã.ûÚfXQûÓX¼ùõÕìúÌÅ...®År×.¹ol.ô..P£ó .Ò¿x¼C.P-Ú´ò}ÆrðõbJ;.a~%
6F1E43CE3E399EE58061DF8EDDEEBDCE5D76331A69B3D990C32DBC43EAABC0D6FBCD998C8D5F8A6
7AA504F7C19FF57EEE6EBE678BE77DFF8E8753EF79FFA639B6971E1BDB773C70EED0E9CF21EF11C
------------------------------------------------------------------------------
>´ÄÌ>D4ìdÿêÒ½MòÏQ®Zuh©I<¹.k÷´Éª7úL¶Sø.C½ò...¹ÐþÄÅ..G.ö1¼Ö#ߣ®..FP¡&äæ.I}´:.3G¨«
6B676CF58D5EBDC7DAEA8BC4D29EB79FDDBE72CBC231DA86623C0CFBE75BA31CDA5493CDB70FCB8
EE38E4484F2D84D78F94849CAE21E1A7E3620638DF50ACE37537FC17CB91FB967A03CF90EA637DA
Extracted File: (Hex ON)
7667660033333333374477567246662566677676677667
251454DA282297183C25CC452025B506C5537125E02F45
676677777324666777756677666677773333737777733332332330033
B495CCCCC1025B5CCCC7112338FF4CCC9950C3CCCCC2007F08F16DA28
Note : The line 3&4 is in continuation with where the line 1,2 ends. The '0D0A' represent end of record. the next record begins in the same ROW. i want it to begin in different ROW
I have tried this Modifying the control card putting data_type(TEXT). i was able to get each new record begining in new ROW
282297183¦BE¦¦Ter Beke Vleeswarenproduktie¦¦¦¦¦1 Beke¦¦¦¦Waarschoot¦¦¦9950¦3¦
282743905¦BE¦¦Tussengemeentelijke Maatschappij der Vlaanderen voor Waterbedel
282743913¦BE¦¦Solva¦¦¦¦¦2-3E INDZ. Industrielaan¦¦¦¦AALST¦¦¦9320¦3¦¦¦¦¦2007/0
282743921¦BE¦¦Intercommunale des Eaux du Centre du Brabant Wallon¦¦¦¦¦27 Rue .
Note: My guess is that PK unzip when we put Data_type(binary), do not resolve the record delimetrs, AM I correct? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
If the file is not too big, you can use REXX's PARSE instruction.
O. |
|
Back to top |
|
|
Kumar shobhit
New User
Joined: 29 May 2007 Posts: 14 Location: bangalore
|
|
|
|
Hi Ofer71,
I dont have any technical knowledge of REXX, could you please tell me in detail , hoe to implement using REXX (If possible, can i have the code). |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Kumar shobhit, I'm under the impression that you've solved your problem by using the DATA_TYPE(TEXT) parameter for PKUNZIP. Am I correct in my understanding, or is there another issue you still need to deal with? |
|
Back to top |
|
|
Kumar shobhit
New User
Joined: 29 May 2007 Posts: 14 Location: bangalore
|
|
|
|
HI Kevin,
Actually the file is in unicode(UTF-8) if i put data type as 'text' while unzipping, i think translation of character set takes place. I want RAW format od data without any translation. (As we are not too sure if translation can cause any problem in near future.).I have one more question , do PKZIP supports unicode?. I hope iam clear in my explanation of the issues i have? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
My guess is that PK unzip when we put Data_type(binary), do not resolve the record delimetrs, AM I correct? |
Yes, when the file is compressed, the cr/lf are not detected by FTP.
How large is your original file? |
|
Back to top |
|
|
Kumar shobhit
New User
Joined: 29 May 2007 Posts: 14 Location: bangalore
|
|
|
|
Hi Dick,
We recieve those file from vendors , so i do not know what would be the file size in near future. Currently i have test file which after unzipping have some 15K records with max Lrecl =1072.( file is VB, so lrecl varies for each record). Any other approch that you would like to suggest, you are welcome |
|
Back to top |
|
|
Alan Voss
New User
Joined: 29 Nov 2006 Posts: 32 Location: Jacksonville, FL
|
|
|
|
If you want to do "meaningful" work with your data on the mainframe, you almost assuredly have to translate the data from ASCII to EBCDIC (data_type=TEXT). I believe that PKZIP allows you to specify the translation tables (don't know, only tried a demo copy a couple of years ago). However, if you have binary values in your data from the originating system, they will get mangled. From what I see of your "text" translated data, that doesn't seem to be the case. If you do have binary values, you'll need to pull the data as binary/image (that is, no translation) and use a tool such as SAS to parse and translate it appropriately. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
With so few records, i'd try the ftp without compressing the file. |
|
Back to top |
|
|
Kumar shobhit
New User
Joined: 29 May 2007 Posts: 14 Location: bangalore
|
|
|
|
Hi Dick ,
Currently iam working with test file. Real production File would be very large. The file we recieve from vendor is a zip file. |
|
Back to top |
|
|
|