Using PARSE on VB Files



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Using PARSE on VB Files

Postby Andyf » Mon Sep 12, 2011 9:12 pm

I'm struggling to get PARSE to work on a VB File.
What I want to achieve is the following
a) Extract records from the VB File (Record format . . . : VB Record length . . . : 204) of the following format, only extract those records where chars from position 16 for length 5 are 10POL (as below)
"0000002","10POL","","0000000085","AV01","ORDM","NOCMGMP","AC",
"0000072","10POL","PZ54128690","0000000011","AV01","MRLY","NOCMGMP","AC",
"0000073","10POL","PZ54148961","0000000012","AV01","MRLY","NOCMGMP","AC",
"0000150","10POL","","0000000090","AV01","ORDM","NOCMGMP","AC",
b) Create an output file whereby the only content is that of the fourth comma delimited field
I was trying to use PARSE along with OUTFIL or OUTREC to define the layout to DFSORT but kept getting error messages

SORT FIELDS=COPY
INCLUDE COND=(16,5,CH,EQ,C'10POL')
OUTREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=9),
%02=(ENDBEFR=C',',FIXLEN=7),
%03=(ENDBEFR=C',',FIXLEN=12),
%04=(ENDBEFR=C',',FIXLEN=13)),
BUILD=(5:%04)
G RECORD TYPE IS V - DATA STARTS IN POSITION 5
2 INCONSISTENT *OUTREC IFTHEN 0 REFORMATTING FIELD FOUND
0 C5-K51706 C6-K51706 C7-K54602 C8-K51706 E7-K51706
3 END OF DFSORT
Andyf
 
Posts: 10
Joined: Mon May 24, 2010 3:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Using PARSE on VB Files

Postby skolusu » Mon Sep 12, 2011 10:51 pm

Andyf ,

Since your input is a VB file , you need to account the RDW too. So your build statement should be as follows.
BUILD=(1,4,%04)


that will produce an VB file with an LRECL of 17 ( 4 bytes RDW + 13 bytes of parsed data)

If you want your output to be a FB then you need to use VTOF parm. Let me know if you are interested in that
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Using PARSE on VB Files

Postby Frank Yaeger » Mon Sep 12, 2011 11:40 pm

Andy,

BTW, since you aren't interested in the first 3 values, you can have PARSE "ignore" them like this:

   ...
   OUTREC PARSE=(%=(ENDBEFR=C','),
      %=(ENDBEFR=C','),
      %=(ENDBEFR=C','),
      %04=(ENDBEFR=C',',FIXLEN=13)),
      BUILD=(1,4,5:%04)
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Using PARSE on VB Files

Postby Andyf » Tue Sep 13, 2011 1:33 pm

Frank,

Thanks for an excellent reply.
I found your document DFSORT: Beyond Sorting, so I was able to use VTOF, although I used it as another sort step rather than putting all the instructions in a single sort step

Thanks
Andy
Andyf
 
Posts: 10
Joined: Mon May 24, 2010 3:16 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Using PARSE on VB Files

Postby Frank Yaeger » Tue Sep 13, 2011 10:54 pm

so I was able to use VTOF, although I used it as another sort step rather than putting all the instructions in a single sort step


So I guess you must like using extra resources for no reason. :roll:
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Using PARSE on VB Files

Postby Andyf » Wed Sep 14, 2011 7:20 pm

We have plenty of power and I like to keep things simple for the next person
Andyf
 
Posts: 10
Joined: Mon May 24, 2010 3:16 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post