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

Problems with parsing delimited VB file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Thu Aug 23, 2012 9:33 pm
Reply with quote

Hi,

I am facing issues while parsing a delimited VB file and writing it to a FB file. Details of the file are as below

1) The data is of variable length fields containing a delimiter of comma (,)
2) Total file length is 850
2) We are not really sure of the length of the last field, we do not have problems if the last field gets truncated also (temporarily a length of 50 has been thought of)
3) The final FB output can also have the same record length as the input

Data in file :

Code:
2010-11-02,88,X,1,0,TEST TEXT*******
2010-11-02,3363,O52,1,0,                                     
2010-11-02,4463,O,212,0,{1510}1000                           
2010-11-02,13635,O,322,0,{2000}0000001                 
2010-11-02,13,X,4,014567,{3100}0610001*

Below is the code I have used to do that

Code:
OPTION COPY,VLSHRT                                 
 INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=10),         
              %02=(ENDBEFR=C',',FIXLEN=6),         
              %03=(ENDBEFR=C',',FIXLEN=1),         
              %04=(ENDBEFR=C',',FIXLEN=7),         
              %05=(ENDBEFR=C',',FIXLEN=5),         
              %=(FIXLEN=50),                       
 BUILD=1:%01)                                       

I am receiving the following abend

Code:
CE805I 1 JOBNAME: ABSORT , STEPNAME: STEP60                               
CE802I 0 BLOCKSET     TECHNIQUE IN CONTROL                                   
CE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                               
CE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES
CE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 11:27 ON THU
          OPTION COPY,VLSHRT                                                 
          INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=10),         
                        %02=(ENDBEFR=C',',FIXLEN=8),         
                        %03=(ENDBEFR=C',',FIXLEN=1),         
                        %04=(ENDBEFR=C',',FIXLEN=10),         
                        %05=(ENDBEFR=C',',FIXLEN=5),         
                        %=(FIXLEN=50),                       
          BUILD=1:%01)                                       
        $                                                                 
CE243A F PARSED FIELD DEFINITION ERROR                                       
CE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K90026 E7-K65446                   
CE052I 3 END OF DFSORT                                                       

Can you please help me with your solution for the problem to finally achieve what I need ?

Your help is very much appreciated

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 23, 2012 9:49 pm
Reply with quote

BUILD is not part of PARSE, you have made it so.

I don't know why you have the trailing %, it is doing nothing for you.

Also note your post has been Code'd. You've been around long enough to know that you should have done this yourself.
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Fri Aug 24, 2012 12:15 am
Reply with quote

Bill,

I really dont know what 'Code'd' means and how did that get populated in my post (haven't observed it) - Please excuse my ignorance and let me know what that is ?

Secondly, I did have a field number %06 for the last field earlier, using which I had no luck or use as I was getting the same error - I remember trying in many ways. I am sure that I had the BUILD as a separate statement in one of my trials. Sorry I couldn't post my trials.

But I always had a question as to how the last field can be handled when we dont know the end of record for each individual record. Your help would give me a better insight on to how such situations can be handled.

Let me know if any extra information has to be furnished.
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Fri Aug 24, 2012 12:17 am
Reply with quote

Sorry I meant I had tried with %06 for earlier tests in the sentence ' I did have a field number %06 for the last field earlier "
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Aug 24, 2012 12:21 am
Reply with quote

Quote:
I really dont know what 'Code'd' means and how did that get populated in my post (haven't observed it) - Please excuse my ignorance and let me know what that is ?


did You look at Your post before and after

after 4 years of being on the forum You should have noticed by now icon_cool.gif

the font used for text is a variable(proportional) font

text surrounded by the code tags is displayed with a fixed font to make code easier to read

normal
12345678901234567890
1234567890abcdef


coded
Code:

12345678901234567890
1234567890abcdef



a moderator took the time to edit Your post in order to make easier for other people to understand You sort cards and Your data
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Fri Aug 24, 2012 12:29 am
Reply with quote

Ok, So I should have used the Code option while preparing a post with code in it - Did I understand it right ?[/code]
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Aug 24, 2012 12:46 am
Reply with quote

only for the things that You usually display on the 3270 session with Your MF
Back to top
View user's profile Send private message
mambopras

New User


Joined: 11 Nov 2008
Posts: 52
Location: Hyderabad

PostPosted: Fri Aug 24, 2012 12:52 am
Reply with quote

Thanks Enrico - Any help you think you can offer on the problem I posted ?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Aug 24, 2012 1:36 am
Reply with quote

mambopras wrote:
Thanks Enrico - Any help you think you can offer on the problem I posted ?


You need to have a closing parenthesis for the PARSE and opening parenthesis for the BUILD

use the following control cards

Code:

 OPTION COPY,VLSHRT   
 INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=10),       
              %02=(ENDBEFR=C',',FIXLEN=6),         
              %03=(ENDBEFR=C',',FIXLEN=1),         
              %04=(ENDBEFR=C',',FIXLEN=7),         
              %05=(ENDBEFR=C',',FIXLEN=5),         
              %=(FIXLEN=50)),                     
   BUILD=(1:%01)     
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 24, 2012 4:03 am
Reply with quote

mambopras wrote:
[...]
But I always had a question as to how the last field can be handled when we dont know the end of record for each individual record. Your help would give me a better insight on to how such situations can be handled.
[...]


Each of your six fields has a logical maximum length, relating to the business requirement. That is the length you use on each respective FIXLEN.

Each parse field will be filled with data, stopping either as it has been told to do (ENDBEFR, etc) or when the length of that FIXLEN is exhausted or when the last byte of the record has been processed.

Code:
 OPTION COPY,VLSHRT   
 INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=10),       
              %02=(ENDBEFR=C',',FIXLEN=6),         
              %03=(ENDBEFR=C',',FIXLEN=1),         
              %04=(ENDBEFR=C',',FIXLEN=7),         
              %05=(ENDBEFR=C',',FIXLEN=5),         
              %06=(FIXLEN=50)),                     
       BUILD=(%01,%02,%03,%04,%05,%06)     


I don't know what you think the VLSHRT is doing for you.

If you have a record like this in your input

Code:
,,,,,


Then you'll get 10, 6, 1, 7, 5 and 50 blanks in the six parsed fields, even though your input record is only five bytes long.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Aug 24, 2012 4:55 am
Reply with quote

I just noticed that your input is VB file so you need the RDW in the BUILD statement or else you would get ICE251A for missing RDW.

If you want FB file then you need to use VTOF. The total length of your FIXLEN is (10+8+1+10+5 =34) , that is what you need to use on your OUTFIL BUILD.

Code:

//SYSIN    DD *                                 
  OPTION COPY,VLSHRT                           
  INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=10),   
               %02=(ENDBEFR=C',',FIXLEN=8),     
               %03=(ENDBEFR=C',',FIXLEN=1),     
               %04=(ENDBEFR=C',',FIXLEN=10),   
               %05=(ENDBEFR=C',',FIXLEN=5),     
               %=(FIXLEN=50)),                 
  BUILD=(1,4,%01,%02,%03,%04,%05)               
  OUTFIL VTOF,BUILD=(5,34)                     
//*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 24, 2012 5:12 am
Reply with quote

mambopras,

I've just noticed your SYSOUT does not match the control cards which you showed. This has lead to some confusion in my and Kolusu's replies. If you let me know the correct FIXLENs I can make the replies consistent. Also whether you want that 6th field or not, please.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top