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
Using PARSE on VB Files
-
Andyf
- Posts: 10
- Joined: Mon May 24, 2010 3:16 pm
- Skillset: CObol, CICS, DB2, JCL
- Referer: Internet Search
-
skolusu
- Posts: 586
- Joined: Wed Apr 02, 2008 10:38 pm
- Skillset: DFSORT
- Referer: Frank Yaeger
Re: Using PARSE on VB Files
Andyf ,
Since your input is a VB file , you need to account the RDW too. So your build statement should be as follows.
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
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
- 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
Andy,
BTW, since you aren't interested in the first 3 values, you can have PARSE "ignore" them like this:
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
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
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
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
- 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
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.
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
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
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
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
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
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
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
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
-
- 1
- 2523
-
by sergeyken
View the latest post
Tue Nov 08, 2022 7:22 pm
-
- 0
- 3393
-
by JIMDOOEY
View the latest post
Tue Mar 01, 2022 8:48 am
-
- 1
- 6746
-
by enrico-sorichetti
View the latest post
Fri Dec 10, 2021 5:23 pm
-
-
How can I copy message queue files (LGMSG,SHMSG) in V9R1
by futohomok » Thu Jul 27, 2023 5:54 pm » in IMS DB/DC - 6
- 4510
-
by futohomok
View the latest post
Thu Aug 03, 2023 1:21 pm
-