Hi All,
Is that possible to separate even numbers into one file and odd numbers into another file using DFSORT
Example:
my input file is
102
125
045
224
155
176
my output files should be
ODD output file
125
045
155
EVEN output file
102
224
176
Please can anyone help on this.
How to Separate Odd or Even numbers using DFSORT
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 32
- Joined: Mon Sep 12, 2011 10:50 am
- Location: Bangalore
How to Separate Odd or Even numbers using DFSORT
Thanks & Regards
Dev
Dev
-
- Member
- Posts: 32
- Joined: Mon Sep 12, 2011 10:50 am
- Location: Bangalore
HI Nic,
Before putting into forum,i have searched the web,but i got answer for position wise i.e odd records will be in one file and evenrecords in another file,but i want to separation on numbers not a position wise.
if you are specifying about the separation by numbers ,could you please paste the link.
Thanks in advance
Before putting into forum,i have searched the web,but i got answer for position wise i.e odd records will be in one file and evenrecords in another file,but i want to separation on numbers not a position wise.
if you are specifying about the separation by numbers ,could you please paste the link.
Thanks in advance
Thanks & Regards
Dev
Dev
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
I think this is not a cross-posting, but a co-incidence.
This is looking at the right-most bit of the right-most byte of your number. If that bit is zero, your number is even. Otherwise it is odd (as bits can only be zero or one).
Code: Select all
OUTFIL FNAMES=EVEN,INCLUDE=(3,1,BI,EQ,B'.......0')
OUTFIL FNAMES=ODD,SAVE
-
- Member
- Posts: 32
- Joined: Mon Sep 12, 2011 10:50 am
- Location: Bangalore
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