IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Probelm in SUBSTRIG sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Wed Oct 28, 2009 2:09 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1248
Location: Richfield, MN, USA

PostPosted: Wed Oct 28, 2009 8:56 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6965
Location: porcelain throne

PostPosted: Wed Oct 28, 2009 9:01 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 28, 2009 9:50 pm
Reply with quote

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
View user's profile Send private message
Kumar Saraboji

New User


Joined: 15 Sep 2009
Posts: 8
Location: India

PostPosted: Thu Oct 29, 2009 7:38 pm
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Alternative of JoinKeys in SORT DFSORT/ICETOOL 2
No new posts Sort SMF records? SYNCSORT 6
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts Simplify SORT CARD to combine INREC a... DFSORT/ICETOOL 6
No new posts Sort card to generate the DSN DFSORT/ICETOOL 17
Search our Forums:


Back to Top