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

How I can search for a string in a record


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

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Fri Jun 05, 2009 8:18 pm
Reply with quote

Can you please let me know how I can search for a string in a record?

My requirement is

I have a file with record length 4600 and its a VB file.
I need to search for a string based on the parm I pass.

ex recs
AAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBAAAAAAAAAAAA
CCCCCCCCCCCCBBBBCCCCCCCCCCCCCCCCCCCCCCCC
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
DDDDDDDDDDDDDDDDDDDBBBBDDDDDDDDDDDDDDDDD
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
EEEEEBBBBEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

in these records i have BBBB some where in free form text....i need to write those records to output.

My output should be
AAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBAAAAAAAAAAAA
CCCCCCCCCCCCBBBBCCCCCCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDBBBBDDDDDDDDDDDDDDDDD
EEEEEBBBBEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Fri Jun 05, 2009 8:20 pm
Reply with quote

I need to pass this BBBB as parm.......and it will be always 4byte string only.......it might be BBBB or CCCC or DDDD.....etc
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jun 05, 2009 9:15 pm
Reply with quote

Hima1985,

The following JCL will give you the desired results. We Plug in a small rexx exec which would read in the symbolic parms you pass and create symbol with the value you passed.

Create a member called HIMSYM in any of your existing pds which contains the following
Code:

/* REXX */                                     
"ALLOC FI(OUTDD) DA('HIMA.sym') SHR REUSE"   
PULL ARG                                       
QUEUE 'SYM1,C'''||ARG(1)||''''                 
"EXECIO 1 DISKW OUTDD (FINIS"                 
"FREE FI(OUTDD)"                               

The above rexx exec will create a 80 byte file
Code:

SYM1,C'BBBB'   


Which we will use in the next step to pass the value to your control cards. You can even make the BBBB as a symbolic and pass it dynamically.

Code:

//STEP0100 EXEC PGM=IKJEFT01,PARM='%HIMSYM BBBB'
//SYSTSPRT DD SYSOUT=*                             
//SYSPRINT DD SYSOUT=*                             
//SYSTSIN  DD DUMMY                                 
//SYSEXEC  DD DSN=HIMA.ANY.PDS.EXEC,DISP=SHR         
//OUTDD    DD DSN=HIMA.SYM,DISP=(,PASS),         
//            SPACE=(TRK,(1,0),RLSE),               
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920)
//* 
//STEP0200 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SYMNAMES DD DSN=HIMA.SYM,DISP=(OLD,DELETE,DELETE)
//SORTIN   DD DSN=your input vb 4600 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  INCLUDE COND=(5,4596,SS,EQ,SYM1)                   
  OPTION COPY,VLSCMP
//*
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Fri Jun 05, 2009 9:37 pm
Reply with quote

Kolusu,

Thanks for the reply, There is no other way other than usin REX?
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Fri Jun 05, 2009 9:43 pm
Reply with quote

Just because i never used rex in my job till now
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jun 05, 2009 10:36 pm
Reply with quote

Hima1985,

Even though you haven't used rexx till now, you had everything coded up for you. cant you just copy and run it and see if it works?

You can always write a program to read the parms and generate the symbols for you . You can pass Symbolic parms to COBOL program which would create the necessary symbol names for the Sort Step.
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Fri Jun 05, 2009 11:58 pm
Reply with quote

Kolusu,

I am 100% sure that the solution provided by you works pretty well, No doubts at all.

Just wanted to know if any otherway around to achieve the same.
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
Search our Forums:

Back to Top