Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Search the strings present in ps file in input pds

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
Bhuvana Narasimhan

New User


Joined: 22 Aug 2019
Posts: 2
Location: India

PostPosted: Thu Aug 22, 2019 8:20 pm    Post subject: Search the strings present in ps file in input pds
Reply with quote

Hi ,

I am new to this forum.I am developing an automation tool for search. Basically the search is to find the source of the DB2 table. The DB2 table names present in programs is stored in PS file which is obtained using searchfor utility . I need to search now these programs present in PS file in separate job pds where its is used. How this can be done?
Back to top
View user's profile Send private message

sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 609
Location: Maryland

PostPosted: Thu Aug 22, 2019 8:32 pm    Post subject: Re: Search the strings present in ps file in input pds
Reply with quote

Bhuvana Narasimhan wrote:
Hi ,
I am new to this forum.

Yes, it is easy to recognize.

Bhuvana Narasimhan wrote:
I am developing an automation tool for search. Basically the search is to find the source of the DB2 table.

How is it related to either JCL, or VSAM????? icon_rolleyes.gif

Bhuvana Narasimhan wrote:
The DB2 table names present in programs is stored in PS file which is obtained using searchfor utility .

How is it related to either JCL, or VSAM????? icon_rolleyes.gif

Bhuvana Narasimhan wrote:
I need to search now these programs present in PS file in separate job pds where its is used.

What did you do to achieve this?

Bhuvana Narasimhan wrote:
How this can be done?

There are obviously 100+ ways of doing this.

First of all, try something by yourself. For instance, try to understand the difference between JCL, VSAM, DB2, job, PS file, searchfor utility, and other smart words.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2299
Location: NY,USA

PostPosted: Thu Aug 22, 2019 9:00 pm    Post subject:
Reply with quote

Bhuvana,
Welcome Here!!

To let anyone help you here, share us the sample data and expected output. So far you can use JOINKEYS with what you want to achieve but again do that first to get to the solution.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 726
Location: Pennsylvania

PostPosted: Thu Aug 22, 2019 10:46 pm    Post subject:
Reply with quote

Many years ago I spent a solid six months working on such a project.

This is no easy task. I will mention a few points to consider.

Since we are talking about DB2 programs, you will not see PGM=MYPROG statement in your JCL.

You will most likely see PGM=IKJEFT1B or IKJEFT01 perhaps
You will have a SYSTSIN DD card that has the driver program perhaps in this fashion:
DSN SYSTEM (PROD1)
RUN PROGRAM (DRIVER) -
PLAN (SOMEPLAN)
END

If you are lucky, that is the program you are looking for and you got your Job name.

More likely, your program is a subroutine of another program. Hopefully you have that documented someplace and you can use your subroutine list to help you.

Don't forget about a Proc called from your Job.

Just a few thoughts to get you going.
Back to top
View user's profile Send private message
Bhuvana Narasimhan

New User


Joined: 22 Aug 2019
Posts: 2
Location: India

PostPosted: Fri Aug 23, 2019 12:51 pm    Post subject: Reply to: Search the strings present in ps file in input pds
Reply with quote

@daveporcelan - I have taken all the points in consideration mentioned by you. Now am stuck with read the programs in PS file line by line and search that in job pds.

Rohit mentioned to use the Joinkeys but that can be used if am going to give 2 input PS files or instream data as input and match but my requirement is not that.

My input:
VIEW A04019T.TEST.OUTPUT2
000001 PARB206
000002 PARB208
000003 PARB209
000004 PARB217
000005 PARB218

Expected output :

Read the first line in PS file (PARB206) and search that in PDS members and if found write in output file.

In searchfor jcl we can hardcode the string that we wanted to search for but I want to read the data in file and search.Can you suggest any to proceed with.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2247
Location: Hampshire, UK

PostPosted: Fri Aug 23, 2019 4:00 pm    Post subject: Reply to: Search the strings present in ps file in input pds
Reply with quote

Plenty of examples in the Rexx forums, bothe here and in the beginners forum.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 726
Location: Pennsylvania

PostPosted: Fri Aug 23, 2019 4:36 pm    Post subject:
Reply with quote

You are on the right track. I used Rexx to read every program.

I had to save Working-Storage fields and the MOVE statements for values moved into them.

This is because most calls are dynamic using the WS field not a literal.

One I completed a program, its information was saved into a pds for future reference.

This way if a driver is called from more than one Job, I only had to process it one.
Same thing if a subroutine is called from multiple places.

This is a very tedious process. Mine takes six hours to run, once every two week.

Note: Rather than try to process the SQL for DB2 usage, I chose to read the SYSIBM.SYSTABAUTH table.
This has all the authorized usage for each module.

Continue on the path you are taking. you will get it.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 323
Location: Denmark

PostPosted: Fri Aug 23, 2019 9:06 pm    Post subject:
Reply with quote

For searching a pds I typicaly use the PDS86 program from CBTTAPE.ORG file 182.
Something like:
zz=outtrap('lst.')
"pds86 '"libname"' FI : '"string"'"
zz=outtrap('off')
Then postprocess the list.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2299
Location: NY,USA

PostPosted: Sat Aug 24, 2019 3:21 am    Post subject:
Reply with quote

Code:
//S1       EXEC PGM=SORT                                       
//SYSOUT    DD  SYSOUT=*                                       
//SORTLIST  DD  SYSOUT=*                                       
//SORTIN DD DSN="YOUR INPUT DSN"                               
//T1       DD  DSN=&&T1,DISP=(NEW,PASS,DELETE),UNIT=SYSDA,     
//             SPACE=(TRK,(1,1),RLSE),                         
//             DCB=(LRECL=88,RECFM=FB,BLKSIZE=0)               
//SYM      DD  DSN=&&S1,DISP=(NEW,PASS,DELETE),UNIT=SYSDA,     
//             SPACE=(TRK,(1,1),RLSE),                         
//             DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)               
//SYSIN    DD    *                                             
 OPTION COPY                                                   
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(510:SEQNUM,8,ZD,             
                  500:X'7D',501:8,7,508:X'7D',509:X'6B'))     
 OUTFIL FNAMES=T1BUILD=(X,500,10,69X,510,8),REMOVECC     
 OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,                     
   TRAILER1=('LASTRCD,+',510,8)       
//S2    EXEC  PGM=SORT                               
//SYSOUT    DD  SYSOUT=*                             

//SORTLIST  DD  SYSOUT=*                             
//SORTIN DD DSN=&&T1,DISP=SHR                         
//SYMNAMES DD DSN=&&S1,DISP=SHR                       
//SORTOUT  DD  SYSOUT=*                               
//SYSIN    DD    *                                   
  OPTION COPY                                         
  OUTFIL REMOVECC,                                   
   IFOUTLEN=80,                                       
    IFTHEN=(WHEN=(81,8,ZD,EQ,LASTRCD),OVERLAY=(11:X)),
    SECTIONS=(1,1,                                   
      HEADER3=(' SELECT *',/,                         
               ' FROM SYSIBM.SYSTABAUTH',/,           
  '   AND TTNAME IN ('),                             
      TRAILER3=(' ) WITH UR;'))         


I would let you make change to HEADER3 query to following query.
Code:
SELECT SUBSTR(TCREATOR, 1 , 8) AS CREATOR                 
     , SUBSTR(TTNAME, 1 , 18)   AS NAME                                 
     , SUBSTR(GRANTEE, 1 , 8)  AS PROGRAM
     , CASE WHEN INSERTAUTH = 'Y' THEN 'C'
            ELSE '-' 
       END      AS C                                 
     , CASE WHEN SELECTAUTH = 'Y' THEN 'R'
            ELSE '-' 
       END      AS R 
     , CASE WHEN UPDATEAUTH = 'Y' THEN 'U'
            ELSE '-'
       END      AS U
     , CASE WHEN DELETEAUTH = 'Y' THEN 'D'                   
            ELSE '-' 
       END      AS D 
     , CASE WHEN COLLID = ' ' THEN '** PLAN **'
            ELSE COLLID                                 
       END      AS "PLAN/COLLECTION"
  FROM SYSIBM.SYSTABAUTH
 WHERE GRANTEETYPE = 'P'
   AND COLLID      =    'TEST'
   AND TCREATOR    =    'SYSIBM'                         
ORDER BY 3 , 2


Once ran, you will get a query formed, use DSNTIAUL to run that query and you will get what you want.
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File transfer issue with end of line ... VINAY PALLELA TSO/ISPF 4 Thu Nov 14, 2019 12:01 am
No new posts Sort to construct single record from ... Deepti_R SYNCSORT 3 Wed Nov 13, 2019 12:14 am
No new posts File compare, where file has header a... VINAY PALLELA SYNCSORT 8 Thu Nov 07, 2019 5:05 pm
No new posts OMIT first and last column of a pipe-... karthikb_itpro DFSORT/ICETOOL 1 Fri Nov 01, 2019 8:24 pm
No new posts How to place name of the file where t... danielgp89 SYNCSORT 18 Thu Oct 17, 2019 12:55 am

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