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

Help needed for finding string in PS within a PS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raj24186

New User


Joined: 04 May 2010
Posts: 9
Location: Chennai

PostPosted: Tue May 04, 2010 12:06 pm
Reply with quote

Hi,
I have a requirement, wherein I have a PS. This PS in turn contains few records that are actually sequential file names. I need to write a JCL to browse these files and search for a particular string at a position and display the same along with the filename.

To be more elaborate:

My PS: xxx.yyy.zz contains the following records(which are in turn filenames):

aa.bbb.ccc
dd.eee.fff
ggg.hh.ii

As mentioned i want to search for a string in these files. My output should display the filename along with the string. For eg. i am searching for "L134" in those 3 datasets, my output should be as follows:

aa.bbb.ccc L1234
ggg.hh.ii L1234

Please let me know how this can be achieved using JCL?

Thanks,
Rajesh.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 12:23 pm
Reply with quote

SAS could do the job.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue May 04, 2010 12:50 pm
Reply with quote

Raj24186 wrote:
Please let me know how this can be achieved using JCL?

It can not be done using JCL

/RANT ON
Once more let us clarify exactly what JCL is.

it is Job Control Language.

By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.

JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.
/RANT OFF

So, if you might just care to tell us which program you wish the JCL to execute, we might be able to help you

As suggested, SAS, and I might say REXX / ISPF
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 04, 2010 2:04 pm
Reply with quote

Read your input file get dataset name and then...
This will give you idea about searching string in the member which you can tweak for dataset.
Back to top
View user's profile Send private message
Raj24186

New User


Joined: 04 May 2010
Posts: 9
Location: Chennai

PostPosted: Tue May 04, 2010 2:28 pm
Reply with quote

I don't have any expertise in SAS:( . Although I am still a novice in REXX, I would appreciate if you could guide me in resolving this problem. Any other alternatives would be very beneficial!! icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 2:30 pm
Reply with quote

Is SAS installed? Then i have a piece of coding to do the job. For the logic
you have to consult the SAS manuals.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 04, 2010 2:35 pm
Reply with quote

Raj24186 wrote:
I don't have any expertise in SAS:( . Although I am still a novice in REXX, I would appreciate if you could guide me in resolving this problem. Any other alternatives would be very beneficial!! icon_biggrin.gif

Have you tried with REXX solution pointed?
Back to top
View user's profile Send private message
Raj24186

New User


Joined: 04 May 2010
Posts: 9
Location: Chennai

PostPosted: Tue May 04, 2010 4:49 pm
Reply with quote

@ Peter, Yes I do have SAS installed. I can give your code a try.

@ Escapa - I have not tried it with Rexx yet!
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 5:43 pm
Reply with quote

Hope this will help :

Code:

//XIBFSRUN JOB 01,MSGCLASS=G,CLASS=D,NOTIFY=XIBF,REGION=0M              00010000
//XIBFSAS  EXEC  SAS,WORK='5000,5000'                                   00060000
//STEPLIB  DD                                                           00070000
//         DD                                                           00080000
//         DD  DSN=XIBF.SAS.LOAD,DISP=SHR                               00090000
//WORK     DD  SPACE=(CYL,(50,50)),DCB=(LRECL=32256,BLKSIZE=32256)      00100000
//SASLIB   DD  UNIT=SYSDA,SPACE=(CYL,(2,2))                             00110000
//FT16F001 DD  SYSOUT=*,DCB=RECFM=FB
//ROOKSCAN DD  *                                                        00160000
* input files to process <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
XIBF.EPA.MACHINE.ALL.A1                                                 00170007
XIBF.EPA.MACHINE.ALL.A2                                                 00180007
XIBF.EPA.MACHINE.ALL.A4                                                 00190007
XIBF.EPA.MACHINE.ALL.FA                                                 00200007
XIBF.EPA.MACHINE.ALL.FC                                                 00210007
XIBF.EPA.MACHINE.ALL.FD                                                 00220007
XIBF.EPA.MACHINE.ALL.FE                                                 00230007
XIBF.EPA.MACHINE.ALL.T3                                                 00240007
//SYSIN    DD  *                                                        00250000
**********************************************************************; 00260000
OPTIONS NOCENTER LS=85  PS=64 MEMSIZE=300M NOMPRINT NOSOURCE2;          00300000
**********************************************************************; 00310000
DATA _NULL_                                                             00320000
   ;                                                                    00330000
   LENGTH DSN $44;                                                      00350000
   INFILE ROOKSCAN;                                                     00360000
   INPUT DSN $;                                                         00370000
   IF SUBSTR(DSN,1,1) = '*' THEN RETURN;                                00380000
   INFILE DUMMY FILEVAR=DSN END=END;                                    00390000
   DO UNTIL(END);                                                       00400000
      INPUT  @1 INREC    $CHAR80./* assuming input files are lrecl=80*/ 00410000
      FILE FT16F001;
      IF INDEX(INREC,'search argument') > 0 THEN /*<<<<<<<<<<<<<<<<<*/
      PUT @1 DSN @46 'search argument';          /*<<<<<<<<<<<<<<<<<*/
   END;                                                                 00470000
RUN;                                                                    00480000
*;                                                                      00490000
Back to top
View user's profile Send private message
Raj24186

New User


Joined: 04 May 2010
Posts: 9
Location: Chennai

PostPosted: Wed May 05, 2010 10:24 am
Reply with quote

Thanks Peter. I will give it a try and let you know!
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts VB to FB - Finding LRECL SYNCSORT 4
Search our Forums:

Back to Top