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
 

 

How to split VB Pipe delimited data so that each record ...

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

New User


Joined: 29 May 2007
Posts: 14
Location: bangalore

PostPosted: Mon Aug 27, 2007 3:09 pm    Post subject: How to split VB Pipe delimited data so that each record ...
Reply with quote

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

superk

Moderator Team Head


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

PostPosted: Mon Aug 27, 2007 8:02 pm    Post subject: Re: How to split VB Pipe delimited data so that each record
Reply with quote

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

Site Director


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

PostPosted: Mon Aug 27, 2007 8:26 pm    Post subject:
Reply with quote

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

New User


Joined: 29 May 2007
Posts: 14
Location: bangalore

PostPosted: Tue Aug 28, 2007 3:21 pm    Post subject: Details ....
Reply with quote

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

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Aug 28, 2007 3:33 pm    Post subject:
Reply with quote

If the file is not too big, you can use REXX's PARSE instruction.

O.
Back to top
View user's profile Send private message
Kumar shobhit

New User


Joined: 29 May 2007
Posts: 14
Location: bangalore

PostPosted: Tue Aug 28, 2007 4:36 pm    Post subject: How to split VB Pipe delimited data so that each record ...
Reply with quote

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

Moderator Team Head


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

PostPosted: Tue Aug 28, 2007 5:37 pm    Post subject: Reply to: How to split VB Pipe delimited data so that each r
Reply with quote

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

New User


Joined: 29 May 2007
Posts: 14
Location: bangalore

PostPosted: Tue Aug 28, 2007 6:09 pm    Post subject: How to split VB Pipe delimited data so that each record ...
Reply with quote

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

Site Director


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

PostPosted: Tue Aug 28, 2007 6:17 pm    Post subject:
Reply with quote

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

New User


Joined: 29 May 2007
Posts: 14
Location: bangalore

PostPosted: Tue Aug 28, 2007 6:47 pm    Post subject:
Reply with quote

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

New User


Joined: 29 Nov 2006
Posts: 32
Location: Jacksonville, FL

PostPosted: Tue Aug 28, 2007 8:42 pm    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Tue Aug 28, 2007 9:08 pm    Post subject:
Reply with quote

Hello,

With so few records, i'd try the ftp without compressing the file.
Back to top
View user's profile Send private message
Kumar shobhit

New User


Joined: 29 May 2007
Posts: 14
Location: bangalore

PostPosted: Wed Aug 29, 2007 11:00 am    Post subject: How to split VB Pipe delimited data so that each record ...
Reply with quote

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
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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