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
 
How I can search for a string in a record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How I can search for a string in a record
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    Post subject: forgot to mention
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    Post subject: Reply to: Search a string
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Search a string
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    Post subject:
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    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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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