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
 

 

Get the name of the Input file where search term is found

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sriky86

New User


Joined: 30 Sep 2009
Posts: 8
Location: india

PostPosted: Thu Dec 23, 2010 5:30 pm    Post subject: Get the name of the Input file where search term is found
Reply with quote

Hi All,

I did attempt to find an existing topic but in vein..

When we search for a particular keyword in a complete GDG file, I want to put the particular version dataset (complete name) which contains the term in a output file.

Eg:
AAA.BBB.CCC - GDG Base
AAA.BBB.CCC.V01
AAA.BBB.CCC.V02
AAA.BBB.CCC.V03

// INPUT1 DD DSN=AAA.BBB.CCC,DISP=SHR
//OUTPU1 DD DSN=XXX.YYY.OUTPUT,DISP=MOD

WHen I give the search term as 'JOHN', if this value is present in AAA.BBB.CCC.V02, I want the output PS datafile to contain.

XXX.YYY.OUTPUT:
JOHN - AAA.BBB.CCC.V02

Thanks for your assistance.
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Thu Dec 23, 2010 6:04 pm    Post subject:
Reply with quote

There are so many confusing things here it is hard to know where to begin.

The main issue, leaving the rest for other commentators:

1. If AAA.BBB.CCC is a GDG base, then there will never be a dataset named AAA.BBB.CCC.V01. The first
generation will be named AAA.BBB.CCC.G0001V00. If you
replace that generation with another version of that same generation, then you will have a dataset named AAA.BBB.CCC.G0001V01, which is the next version of the first generation.

Once you can use the correct terminology, then you'll know what you are talking about, and only then will we know what you are talking about, and only then can you pose a cogent question.
Back to top
View user's profile Send private message
sriky86

New User


Joined: 30 Sep 2009
Posts: 8
Location: india

PostPosted: Thu Dec 23, 2010 7:30 pm    Post subject:
Reply with quote

Phil,

Whatever I've put was just a sample. I didn't actually mean that a GDG is in that convention.

Wat I'm talking about is :

Scan through the whole GDG for a SEARCH TERM and finally put the VERSION dataset filename (where the search term is found) into a flat file.

Hope this further explains.

Thanks for your post.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Dec 23, 2010 9:04 pm    Post subject:
Reply with quote

sriky86 wrote:
Wat I'm talking about is :

...something that you are apparently incapable of expressing, even after you have been given an explanation and the correct terminology. icon_evil.gif

Go learn the difference between a generation of a GDS and a version of a GDS, then come back and ask your question properly.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Thu Dec 23, 2010 9:14 pm    Post subject:
Reply with quote

sirky86,

Quote:
Whatever I've put was just a sample. I didn't actually mean that a GDG is in that convention.



1) Why would you you create a sample that shows an invalid convention?

2) Do you want an answer that is equally invalid as your sample?

3) How do you plan on doing your scan/search? Do you want to use a Sort product? Do you want to use ISRSUPC?



Quote:
Scan through the whole GDG for a SEARCH TERM and finally put the VERSION dataset filename (where the search term is found) into a flat file.



4) Do you really mean VERSION? You put it in CAPS like that is really what you want. Or do you mean generation? Do you understand the difference?


Quote:
Hope this further explains


This explains you have alot of work to do if you want help.

You need to understand what you are talking about.
You need to use correct terminology.
You need to give accurate examples.
You need to be specific of what you want to acheive.
Back to top
View user's profile Send private message
sriky86

New User


Joined: 30 Sep 2009
Posts: 8
Location: india

PostPosted: Tue Dec 28, 2010 6:53 pm    Post subject:
Reply with quote

Apologies for the mis-directing posts. I did go through the GDG basic stuffs and now I realize where I went wrong in my request.

Below are the GDG base and the generations
ABC.STOCK.YEAR
ABC.STOCK.YEAR.G0001V00
ABC.STOCK.YEAR.G0002V00
ABC.STOCK.YEAR.G0003V00
ABC.STOCK.YEAR.G0004V00

The JCL should scan through all the generations of the GDG for a specific keyword and when found, it must write the whole name (Eg: ABC.STOCK.YEAR.G0002V00) that holds the keyword and the line in which it is present, in the output dataset.

Quote:
3) How do you plan on doing your scan/search? Do you want to use a Sort product? Do you want to use ISRSUPC?

I'm looking for any means to implement this requirement. Nothing in particular.

Kindly let me know if this is a complete request.

Thanks in advance.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Dec 28, 2010 7:31 pm    Post subject:
Reply with quote

In my opinion, this can be done, but is not as simple as one would like.

The problem is if you concatenate all generations, using the base alone, with ISRSUPC or SORT, the data can be identified, but the specific generation can not be accurately identified.

If this was a requirement I had to fulfill (because I was being paid to do so), I would:

1) Use a REXX program to identify the specific generations
2) For each generation, call ISRSUPC internally for each one, writting the output to a dataset with disp=mod
3) Re-format the output dataset as needed to meet the requirement

Like I said, it can be done, but not real easy, especially if you are a novice.

If someone else has a better solution, I am sure the Sriky86 would appreciate it.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 28, 2010 10:30 pm    Post subject:
Reply with quote

Hello,

One very easy way to do this is to create a small inline PROCedure to run SUPERC/searchfor that has the generation defined as a symbolic parameter - i.e.:
//NEWDD DD DSN=MY.GDGBASE.&GEN,DISP=SHR

Then after the PROC/PEND, execute the PROC once for each generation:
//S1 EXEC THEPROC,GEN=G0001V00
//S1 EXEC THEPROC,GEN=G0002V00
etc.

This requires no knowledge other than basic JCL. The search jcl can be generated from the online screen and copied into the PROC.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 961
Location: Richmond, Virginia

PostPosted: Wed Dec 29, 2010 10:19 am    Post subject:
Reply with quote

A SAS program can determine the sequential number of the dataset in a concatenation a record is read from. This would require specifying a concatenation of all generations.

I do not know, however, if it can do so when the concatenation is presented merely by specifying the GDG base.

When specifying the GDG base, the generations are read in reverse order, so I think it unlikely that this would look the same to SAS.

I may just test that some day.
Back to top
View user's profile Send private message
sriky86

New User


Joined: 30 Sep 2009
Posts: 8
Location: india

PostPosted: Mon Jan 17, 2011 4:45 pm    Post subject:
Reply with quote

Hi Dick,

Quote:
The search jcl can be generated from the online screen and copied into the PROC.


I tried finding how to get the search JCL from online screen but not much luck.

Can you give me a sample please

Thanks in advance
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 17, 2011 6:05 pm    Post subject:
Reply with quote

It's your screen, how do you expect us to tell you?
especially since we do not even know the environment within which you are receiving the search request.

use a batch superc
goto 3.15 ispf options. - and then save the jcl generated.
then you will have examples of multiple search statements,

then use the gdg base as your newdd.

then you can write a rexx (or use dfsort) to parse the output and generate your little report.

yeah, you have to go to the end of the superc output to find out which dataset name belongs to the concatenation order.

you could even write a REXX edit macro to accmplish that while you view/edit the dataset.
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 Performing arithmetic on input field zh_lad DFSORT/ICETOOL 24 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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