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

Search for a dataitem in a GDG having 50 generations


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shirazpasha

New User


Joined: 24 Nov 2006
Posts: 14
Location: India

PostPosted: Mon Nov 05, 2007 5:37 pm
Reply with quote

Hi,
I have a requirement where I have to search for a particular dataitem which lies in column 10, having length of 10 characters in a GDG file. There are 50 generations of that GDG base. All these gens are output of the same program and so they have same record layout.

I want to accomplish this in a JCL. Is there a way out?

Thanks,
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


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

PostPosted: Mon Nov 05, 2007 6:01 pm
Reply with quote

Referencing the base name only in a DD statement implicitly concatenates all extant generations. So reference the base name as the input file in your search JCL.

Note, though, that they are processed in reverse order.

I've been wondering why it's implemented that way - anyone know?
Back to top
View user's profile Send private message
Shirazpasha

New User


Joined: 24 Nov 2006
Posts: 14
Location: India

PostPosted: Mon Nov 05, 2007 6:12 pm
Reply with quote

Phil,
Thanks for the reply.
I wanted to know which JCL utility to use to do this.
In other words, how would my jcl look like.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Nov 05, 2007 6:17 pm
Reply with quote

look at the jcl sketch in the quoted post
http://www.ibmmainframes.com/viewtopic.php?t=25740&highlight=
and modify the inline proc accordingly...
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


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

PostPosted: Mon Nov 05, 2007 6:43 pm
Reply with quote

Go to 3.14 and set the parms to do a batch search for anything from one dataset.

Then copy the generated JCL to your own PDS and modify it accordingly.

Now you've got search JCL you can modify anytime without using the 3.14 screen.

This general method works for any panel that has foreground and batch options; e.g., 3.13 - file compare.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Nov 05, 2007 7:47 pm
Reply with quote

Shirazpasha
What is the data item Format(CH,PD,ZD..)?
Back to top
View user's profile Send private message
Shirazpasha

New User


Joined: 24 Nov 2006
Posts: 14
Location: India

PostPosted: Tue Nov 06, 2007 12:41 am
Reply with quote

Phil,
Your approach would require me to change my jcl to search in each gdg version, I guess. But i do not want to do that. I want to search all the versions in one go.

Kris,
My data item formt is character. Actually there are 2 dataitems that i need to look for. serial#, a Packed Decimal item and a customer name, which is of character datatype.

Thanks,
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


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

PostPosted: Tue Nov 06, 2007 1:00 am
Reply with quote

I think my suggestion works.

Specifying DSN=<GDG base> effectively gives you the concatenation of all generations (not versions).

Of course, when you find your text you won't know which it is in, so I guess that is your problem.

If you know SAS, a slightly advanced features lets you identify which dataset of a concatenation you are currently reading.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Nov 06, 2007 1:07 am
Reply with quote

Quote:
But i do not want to do that.


You can run "isrsupc" the ispf search for program , but ,

a concatenation will be seen as a "SINGLE" sequential dataset

and isrsupc will give a RELATIVE line number of the found string,
but You will not have any reference to the dataset were the string was found

So YOU CANNOT HAVE WHAT YOU WANT,
were is the problem in getting the model JCL from a 3.14
and use the model to build the complete job

here is an almost working sample

Code:

//anyname  JOB ....
//* inline proc to invoke srchfor
//SEARCH  PROC GEN=
//ISR     EXEC PGM=ISRSUPC,PARM=(SRCHCMP,'')
//*
//SYSIN     DD DISP=(OLD,PASS),DSN=&&CARDS
//*
//NEWDD     DD DISP=SHR,DSN=your_gdgname(&GEN)
//*
//OUTDD     DD SYSOUT=*
//        PEND
//* first step priming the cards dataset
//PRIME   EXEC PGM=IEBGENER
//SYSIN     DD DUMMY
//SYSPRINT  DD SYSOUT=*
//SYSUT1    DD *
SRCHFOR 'your_char_string'
CMPCOLM first_col:last_col
//SYSUT2    DD DISP=(NEW,PASS),DSN=&&CARDS,
//             UNIT=VIO,SPACE=(CYL,(1,1)),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120)
//*
//* and here is the rest
//         EXEC SEARCH,GDG='0'
//         EXEC SEARCH,GDG='-1'
//         EXEC SEARCH,GDG='-n'

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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts first column truncated in search result IBM Tools 13
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts To search DB2 table based on Conditio... DB2 1
Search our Forums:

Back to Top