MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Searching all GDG versions for acct number

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sreedhar_k
Beginner


Joined: 24 May 2006
Posts: 6
Topics: 1

PostPosted: Tue May 08, 2007 4:11 am    Post subject: Searching all GDG versions for acct number Reply with quote

Hi,

This is my first query on this forum.

Description of task :
I have a GDG with 100 versions created on different days. My task is to search all the versions of the GDG for account number field ACT-NO of length 10( starts from 1-10 positions) in all versions and retrieve corresponding transaction number TRANS-NO(which starts from 20-25 positions).
For suppose, if ACT-NO is found in 2 GDG versions.Then the output file must get printed with first record ACT-NO(1-10 position) , TRANS-NO(20-25 posions) and in additon on 40th position need to print date of creation of GDG version from which the account number is picked( in this eample acct num is found in GDG version1. so creation date must be printed in output file on 40th position.Also since acct num is in second version also
ACT-NO,TRANS-NO must be printed in output file along with DATE of creation of second GDG version.

I tried merging all the GDG versions into a flat file and search for acct num and TRANS-number , but i don't understnad how to get the correponding date of creation of GDG versionget printed.

Please suggest me how to proceed.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue May 08, 2007 4:25 am    Post subject: Reply with quote

1. This is a JCL forum, not utilities or rexx.

2. instead of mergeing all the gdg's into one, you could have referenced the base and read them all - now that's JCL

3. you cannot determine inidividual file attributes (e.g. creation date) of a concantenated set. that's also JCL

4. there are numerous examples in the REXX and Programming forums how one can dynamically allocate a dataset, access the 'creation date' and process the file. It might be easier to run a dslist against the base which would provide the qualified gdg version name instead of the reference (+1, etc...) and the date, then use this list as a trigger file to dynamically allocate and process each. But that is Programming or REXX. you could generate and process this dslist with your program instead of creating the trigger file by hand, but based on your questions, I don't think you understand enough to do that.

so, decide what you want to do and post your question in the appropriate forum.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 4:28 am    Post subject: Reply with quote

If you do a listc on the gdg you will get creation date. write a prog to extract that info and insert into the output file before the gdg it refers to.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
sreedhar_k
Beginner


Joined: 24 May 2006
Posts: 6
Topics: 1

PostPosted: Tue May 08, 2007 4:51 am    Post subject: Reply with quote

Dick Brenholtz ,
sorry for posting in wrong forum. i thought as my doubt was on GDG it would be apt to put it in JCL forum.

Nic,
Thanks for your help.LISTC gives creation date of GDG.

I think my description is not clear.

For suppose i have a GDG with two versions( as shown below:)
XXXX.SAMPLE.GDG
XXXX.SAMPLE.GDG.G0001V00
XXXX.SAMPLE.GDG.G0002V00

The first GDG version contains data as follows:
----+----1----+----2----+----3----+----4----+----5
1111111111 TRAN3
2222222222 TRAN1
2222222222 TRAN2
3333333333 TRAN4

The second GDg version cotains data as follows:
----+----1----+----2----+----3----+----4----+
4445678844 TRAN3
1111111111 TRAN3
2222222222 TRAN1
5555567677 TRAN2
7899900009 TRAN4
2222222222 TRAN7
3333333333 TRAN4

both versions are of same record length. Acount number startd from 1-10 postions and Transaction nmber from 20-25 postions.

Now my task is to search for a specific acct number in both versions and get the corresponding transaction number along with creation date of GDG version containing acct number at 40th position.

For suppose am searching for acct numer : 2222222222
The output must be like this:
acct-num(1-10) tran(20-25) date(40-50)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
2222222222 TRAN1 creation dateof first GDG version file
2222222222 TRAN2 creation dateof first GDG version file
2222222222 TRAN1 creation date of second GDG version file
2222222222 TRAN7 ceation date of second GDG version file


Thanks & Regards,
Sree
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 08, 2007 5:06 am    Post subject: Reply with quote

So you get your LISTC output and extract the date and when you merge the gdgs you slip the creation date in before the data for the relevant gdg. OK, this would probably have to be a one-off exercise although it could be automated with dynamic alloaction as Dick suggested.

I envisage your output file to be like this:
Code:

Date for g0001v00
data for g0001v00
more data for g0001v00
Date for g0002v00
data for g0002v00
etc
etc

_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
sreedhar_k
Beginner


Joined: 24 May 2006
Posts: 6
Topics: 1

PostPosted: Tue May 08, 2007 5:17 am    Post subject: Reply with quote

Nic,

The output file is like as you have mentioned.
I don't know REXX. this needs to be done using SORT and JCL.

I tried to use sort. but don't know how to get the creation date of GDG version.
please suggest me with an example.


Thanks,
Sree
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue May 08, 2007 5:22 am    Post subject: Reply with quote

Sree,

the fact that the datasets are gdg's only means that you have 2 names for each file instead of 1
  • XXXX.SAMPLE.GDG.G0001V00
  • XXXX.SAMPLE.GDG(-1) in this case since you only have 2


you need to build a cross-ref (an extract of all gdg's), and sort by account number, and then access this cross reference for any queries that need satisfied.

So, again,
  • 1 create a filename/date file from a dslist
  • use this as input to a program that will dynamically allocate each of the 100 datasets in turn
  • alternatively, write a rexx or a program that allocates only one dataset, modifiying the DD statement in the JCL and execute 100 times appending (MOD) the output
  • strip the input, and as NIC said, populate the file date in any records that you generate

_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Tue May 08, 2007 5:26 am    Post subject: Reply with quote

Depending on the size of the input files, I might suggest that in the case of multiple searches that you read the file with the account numbers to be searched for into a stem variable, and process this against each gdg version in turn.

This means that you will only have to read the big, well at least I assume so, gdg files only once for any reasonable number of searches, perhaps up to 1,000 or so.

Also suggest that if the gdg data is pretty big that you read and process it in sections, say perhaps 10,000 records at a time as not to encounter any problems with resources.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Tue May 08, 2007 5:28 am    Post subject: Reply with quote

And while I typed all of that, I now see that REXX isn't an option.

Oh well, c'est la vie Confused
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
sreedhar_k
Beginner


Joined: 24 May 2006
Posts: 6
Topics: 1

PostPosted: Tue May 08, 2007 5:30 am    Post subject: Reply with quote

hi Dick Brenholtz & NIC,

Thanks to both of you for sharing your ideas.

I got some clear picture regarding how to proceed.
I will go ahead and do as indicated.

Thanks for your ime.

--Sree
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue May 08, 2007 7:14 am    Post subject: Reply with quote

sreedhar_k,

Check this link which shows how to extract the create dates of a gdg

http://www.mvsforums.com/helpboards/viewtopic.php?t=2104&highlight=create+gdg

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group