MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Omit records based on value in a PD

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sub
Beginner


Joined: 30 Jan 2007
Posts: 20
Topics: 12

PostPosted: Wed Oct 28, 2009 10:42 am    Post subject: Omit records based on value in a PD Reply with quote

Hi,
I have VB file. The length of that file is 150. There is a field in that file starting at position 12 which is S9(9) comp-3. I need to exclude only the records with the value '345' starting at position 3 of this comp-3 field.

Sample i/p:
----------------12--------- <---column position
ABCDEFGHIJK11345111
AB1DEFGHIJK22123232 <--- expected in output
AB2DEFGHIJK22345222
AB3DEFGHIJK33345333
AB4DEFGHIJK33045333 <--- expected in output

Expected o/p:
AB1DEFGHIJK22123232
AB4DEFGHIJK33045333

Is there a way to do this one using SORT? Can someone please help.
Thanks.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Oct 28, 2009 5:36 pm    Post subject: Reply with quote

An S9(9) COMP-3 field is a 5-byte PD field in DFSORT terms so the PD value 11345111 would look like this in hex:

011345111C

Is that what your value looks like? If not, then you need to show us in hex what it does look like.

If that is what your value looks like, then I think you are saying you are looking for 345 as the 4th-6th digits of the PD value. So you'd want to check if positions 17-18 have x345 (since your input is VB, the first 4 bytes have the RDW and the first data byte starts in position 5). You could use a DFSORT job like the following to get what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(17,2,BI,EQ,B'....001101000101')
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group