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
 

 

Search for a dataitem in a GDG having 50 generations

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Search for a dataitem in a GDG having 50 generations
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

Active Member


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

PostPosted: Mon Nov 05, 2007 6:01 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10279
Location: italy

PostPosted: Mon Nov 05, 2007 6:17 pm    Post subject: Reply to: Search for a dataitem in a GDG having 50 generatio
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

Active Member


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

PostPosted: Mon Nov 05, 2007 6:43 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Search for a dataitem in a GDG having 50 generatio
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

Active Member


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

PostPosted: Tue Nov 06, 2007 1:00 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10279
Location: italy

PostPosted: Tue Nov 06, 2007 1:07 am    Post subject: Reply to: Search for a dataitem in a GDG having 50 generatio
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Compare each GDG Generations to other... Ayyappa1 JCL & VSAM 13 Tue Jun 28, 2016 1:48 pm
No new posts Search a Load Module sreekanth1984 TSO/ISPF 8 Tue Jun 07, 2016 8:45 pm
No new posts Editing "member generations"... Ricardo Viegas TSO/ISPF 1 Tue Dec 29, 2015 7:27 pm
No new posts Copy one PDS to another PDS based on ... alluri12 JCL & VSAM 10 Tue Sep 29, 2015 8:10 pm


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