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

Search and pull next 18 characters


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

New User


Joined: 21 Apr 2009
Posts: 9
Location: Cedar Rapids Iowa

PostPosted: Tue Oct 18, 2011 11:33 pm
Reply with quote

I have a VB file that can have a string I need to find in any position. Once I find it, I need to have it and the next 18 positions displayed in the output.

rec length=4504 and I use the following statement to search for the string
INCLUDE COND=(5,4499,SS,EQ,C'113A025')

but do not know how to include the next 18 characters after the string in my output file.

here is the entire code:

Code:
//RUNSORT1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=infile,DISP=SHR 
//SORTOF00 DD DSN=outputfile,                 
//         DISP=(,CATLG,CATLG),
//         SPACE=(CYL,(10,10),RLSE)                 
//SYSIN    DD *                                     
  OPTION COPY                                   
  INCLUDE COND=(5,4499,SS,EQ,C'113A025')             
  OUTFIL FILES=00,VTOF,                             
    OUTREC=(5,4499)                                   
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Wed Oct 19, 2011 12:38 am
Reply with quote

Hi Mike,

i used below mentioned SORTCARD for Fixed Length Input file.

Code

Code:
//VSEKARS6 JOB (ACCOUNT),'VSEKARS',MSGCLASS=X,           
//         CLASS=A,NOTIFY=VSEKARS                         
//*                                                       
//STEP01  EXEC PGM=SORT                                   
//SYSPRINT  DD SYSOUT=*                                   
//SYSOUT    DD SYSOUT=*                                   
//SORTIN    DD DSN=VSEKARS.SAI.TEST,DISP=SHR             
//SORTOUT   DD SYSOUT=*                                   
//SYSIN  DD  *                                           
 SORT FIELDS=COPY                                         
 INREC IFTHEN=(WHEN=(1,80,SS,EQ,C'113A025'),             
       PARSE=(%01=(STARTAFT=C'113A025',FIXLEN=18)),       
       BUILD=(1:%01,80:X)),                               
       IFTHEN=(WHEN=(1,80,SS,NE,C'113A025'),             
       BUILD=(80:X))                                     
 OUTFIL FNAMES=SORTOUT,REMOVECC,                         
 INCLUDE=(1,80,CH,GT,C' ')                               
/*                                                       


Input:

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
MYSAI113A02512345678901234567890                                               
113A025SAI45678901234567890                                                     
TEST                                                                           
SAITEST                                                                         


Output:
Code:
123456789012345678
SAI456789012345678
Back to top
View user's profile Send private message
mike beckmann

New User


Joined: 21 Apr 2009
Posts: 9
Location: Cedar Rapids Iowa

PostPosted: Wed Oct 19, 2011 12:54 am
Reply with quote

saiprasadh,

Thank you very much for such a timely response - worked great!
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 Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts first column truncated in search result IBM Tools 13
Search our Forums:

Back to Top