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
 

 

Help needed for finding string in PS within a PS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Help needed for finding string in PS within a PS
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: 2433
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 12:23 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue May 04, 2010 12:50 pm    Post subject: Re: Help needed for finding string in PS within a PS
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    Post subject:
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    Post subject: Reply to: Help needed for finding string in PS within a PS
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: 2433
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 2:30 pm    Post subject:
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    Post subject: Re: Reply to: Help needed for finding string in PS within a
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    Post subject:
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: 2433
Location: Netherlands, Amstelveen

PostPosted: Tue May 04, 2010 5:43 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


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