Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Probelm in SUBSTRIG sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Probelm in SUBSTRIG sort
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Oct 28, 2009 9:01 pm    Post subject:
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 Moderator


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

PostPosted: Wed Oct 28, 2009 9:50 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us