View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
I have a VB record of 10000 length.The criteria is to select those records in which there is a value 89 followed by any S9(4) COMP variable and then C'01'.
For example if the S9(4) COMP variable value is 202 I can give
(5,10000,SS,EQ,X'F8F900CAF0F1')
But I don't know the exact value in the COMP variable. So the records that should be in the output have the criteria
89<followed by a COMP variable>01. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Since any 2-byte field is a valid COMP variable, it really doesn't matter, does it? You should only have to check for X'F8F9' followed by X'F0F1' 2 bytes later. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you should check the manual:
something about record size and available manipulation.
not sure if it applies, but Frank or Kolusu will be along and clear that up. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Substring search does NOT have a wildcard capability so you can't use it to do what you want. However, you can use DFSORT's PARSE function to do it with a job like this:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/10000)
//SORTOUT DD DSN=... output file (VB/10000)
//SYSIN DD *
OPTION COPY
INREC PARSE=(%01=(STARTAT=C'89',FIXLEN=2),
%=(FIXLEN=2),
%02=(FIXLEN=2)),
BUILD=(1,4,%01,%02,5)
OUTFIL INCLUDE=(5,4,CH,EQ,C'8901'),
BUILD=(1,4,9)
/*
|
|
|
Back to top |
|
|
Kumar Saraboji
New User
Joined: 15 Sep 2009 Posts: 8 Location: India
|
|
|
|
Hi Frank,
I am just discovering how powerful DFSORT is. Thanks for the solution, will surely helps at some time.
With Regards,
Kumar |
|
Back to top |
|
|
|