Using PARSE on VB Files

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER
Andyf
Posts: 10
Joined: Mon May 24, 2010 3:16 pm
Skillset: CObol, CICS, DB2, JCL
Referer: Internet Search

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

skolusu
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Skillset: DFSORT
Referer: Frank Yaeger

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.

Code: Select all

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

User avatar
Frank Yaeger
Global moderator
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Skillset: DFSORT, ICETOOL, ICEGENER
Referer: Search
Contact:

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:

Code: Select all

   ...
   OUTREC PARSE=(%=(ENDBEFR=C','),
      %=(ENDBEFR=C','),
      %=(ENDBEFR=C','),
      %04=(ENDBEFR=C',',FIXLEN=13)),
      BUILD=(1,4,5:%04)
Frank Yaeger - DFSORT Development Team (IBM) - [email protected]
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Andyf
Posts: 10
Joined: Mon May 24, 2010 3:16 pm
Skillset: CObol, CICS, DB2, JCL
Referer: Internet Search

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

User avatar
Frank Yaeger
Global moderator
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Skillset: DFSORT, ICETOOL, ICEGENER
Referer: Search
Contact:

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) - [email protected]
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Andyf
Posts: 10
Joined: Mon May 24, 2010 3:16 pm
Skillset: CObol, CICS, DB2, JCL
Referer: Internet Search

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

verabb
Posts: 5
Joined: Thu Dec 04, 2025 4:25 pm
Skillset: COBOL
Referer: From searched

Re: Using PARSE on VB Files

Postby verabb » Tue Mar 31, 2026 4:16 pm

skolusu wrote:Andyf ,

Since your input is a VB file , you need to account the RDW too. So your build statement should be as follows.

Code: Select all

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

verabb
Posts: 5
Joined: Thu Dec 04, 2025 4:25 pm
Skillset: COBOL
Referer: From searched

Re: Using PARSE on VB Files

Postby verabb » Tue Mar 31, 2026 4:17 pm

I know it is an old topic I woukd be interested in this solution :)

enrico-sorichetti
Global moderator
Posts: 3011
Joined: Fri Apr 18, 2008 11:25 pm
Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
Referer: www.ibmmainframes.com

Re: Using PARSE on VB Files

Postby enrico-sorichetti » Tue Mar 31, 2026 6:13 pm

resurrecting a 15 years old topic is considered bad forum manners,
start a new topic describing your problem an the steps you have taken to try to solve it
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

  • Similar Topics
    Replies
    Views
    Last post