Hi....
i have a series of FB 80 records, in which some, but not all, have, at a variable position the characters ".R1", ".R2", or ".R3".
I want to write out only records which have one of the ".R" variants, AND
a 4 byte blank field 7 bytes beyond where the ".R" variant started.
I've tried several (thousand?) variants on
PARSE=(%=(STARTAT=C'.R1',FIXLEN=3),
%01=(ADDPOS=6,FIXLEN=4),
%=(ABSPOS=1,STARTAT=C'.R2',FIXLEN=3),
%02=(ADDPOS=6,FIXLEN=4)),
BUILD=(%01,%02,
9:1,80))
to form an "intermediate" record bering "flags" and the original data, hoping to use OUTREC processing to select only those "tagged" records.
I strongly suspect I may be barking up a blue herring!
Can anyone help?
Steve
Parsing occurences of moveable data.
Moderators: Frank Yaeger, Moderator Group
Parsing occurences of moveable data.
The only stupid question is the one you DON'T ask!
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Please show me an example of your input records and what you expect for output. Show all of the variations you need to handle in the example.
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Frank....
10 sample data records follow (FB/80, trailing blanks)-
FSH1.P0.SHOPPER.GE.NDM.TRANS.NEIL 300316 08/04/08
FSH1.P0.SHOPPER.NBS.MASTER.R1.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.MERCH.NBS.MASTER.R1.FRED 301049 06/11/29
FSH1.P0.SHOPPER.NBS.MASTER.R2.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.SHOPPER.NBS.MASTER.R2.COMP.FTO 301089 06/11/29
FSH1.P0.SHOPPER.NBS.MASTER.R3.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.SHOPPER.TRANS.R3.BKUP 301049 06/11/29
FSH1.P0.SHOPPER.NBS.MAST.R4.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.SHOPPER.NBS.MASTER.R2.BKUP(0) 301089 06/11/29
FSH1.P0.SHOPPER.PAY.PROT.R9.TRANS 300444 07/10/30
I want to output only records with ".R1", ".R2", or ".R3" at any position, AND 4 blank characters at +5 after the end of the ".Rn" character string.
In the above 10 records, I would only require records 2 and 6.
Hoping this helps....
10 sample data records follow (FB/80, trailing blanks)-
FSH1.P0.SHOPPER.GE.NDM.TRANS.NEIL 300316 08/04/08
FSH1.P0.SHOPPER.NBS.MASTER.R1.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.MERCH.NBS.MASTER.R1.FRED 301049 06/11/29
FSH1.P0.SHOPPER.NBS.MASTER.R2.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.SHOPPER.NBS.MASTER.R2.COMP.FTO 301089 06/11/29
FSH1.P0.SHOPPER.NBS.MASTER.R3.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.SHOPPER.TRANS.R3.BKUP 301049 06/11/29
FSH1.P0.SHOPPER.NBS.MAST.R4.BKUP.CPSFPS 300884 06/07/04
FSH1.P0.SHOPPER.NBS.MASTER.R2.BKUP(0) 301089 06/11/29
FSH1.P0.SHOPPER.PAY.PROT.R9.TRANS 300444 07/10/30
I want to output only records with ".R1", ".R2", or ".R3" at any position, AND 4 blank characters at +5 after the end of the ".Rn" character string.
In the above 10 records, I would only require records 2 and 6.
Hoping this helps....
The only stupid question is the one you DON'T ask!
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Here's a DFSORT job that will do what you asked for:
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'.R1',OR,
1,80,SS,EQ,C'.R2',OR,
1,80,SS,EQ,C'.R3')
INREC PARSE=(%=(ENDBEFR=C'.R1',ENDBEFR=C'.R2',ENDBEFR=C'.R3'),
%=(FIXLEN=5),%01=(FIXLEN=5)),
OVERLAY=(81:%01)
OUTFIL INCLUDE=(81,4,CH,EQ,C' ')
/*
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Glad to help. By the way, I realized later that there's a slightly simpler solution as follows:
Code: Select all
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'.R1',OR,
1,80,SS,EQ,C'.R2',OR,
1,80,SS,EQ,C'.R3')
INREC PARSE=(%=(ENDBEFR=C'.R1',ENDBEFR=C'.R2',ENDBEFR=C'.R3'),
%01=(ADDPOS=5,FIXLEN=5)),
OVERLAY=(81:%01)
OUTFIL INCLUDE=(81,4,CH,EQ,C' ')
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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page