Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Search and pull next 18 characters

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Search and pull next 18 characters
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    Post subject:
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    Post subject: Reply to: Search and pull next 18 characters
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    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 Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us