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: 1249
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: 6966
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top