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
 

 

Problems with parsing delimited VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Problems with parsing delimited VB file
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 23, 2012 9:49 pm    Post subject: Reply to: Problems with parsing delimited VB file
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    Post subject: Reply to: Problems with parsing delimited VB file
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    Post subject: Reply to: Problems with parsing delimited VB file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Aug 24, 2012 12:21 am    Post subject: Reply to: Problems with parsing delimited VB file
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    Post subject: Reply to: Problems with parsing delimited VB file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Aug 24, 2012 12:46 am    Post subject: Reply to: Problems with parsing delimited VB file
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    Post subject: Reply to: Problems with parsing delimited VB file
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    Post subject: Re: Reply to: Problems with parsing delimited VB file
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 24, 2012 4:03 am    Post subject: Re: Reply to: Problems with parsing delimited VB file
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 24, 2012 5:12 am    Post subject: Reply to: Problems with parsing delimited VB file
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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