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
 

 

Merging GDG versions bases on a Key field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Krushna Maharana

New User


Joined: 25 Nov 2007
Posts: 3
Location: Weston, FL

PostPosted: Mon Nov 26, 2007 5:53 am    Post subject: Merging GDG versions bases on a Key field
Reply with quote

Hi,

I have a requirement where we need to merge available GDGs and create a report on a tabular form. Now I went thru numerous examples which helps you merging two files with SPLICE on ICETOOL. But in my requiement the number of files varies from one to 30 in a particulat month. I mean in the day-1 its just one file. in Day 5 there would be 5 files to merge. So basically my files are catalogued as an GDG version to a base. Let me give an example to explain more.

PSAK.DAILY.STAT is the GDG base.

PSAS.DAILY.STAT.G0001V00
----------------------------------
ABC 002345
DEF 002965
AKL 002878

PSAS.DAILY.STAT.G0002V00
----------------------------------
ABC 002300
DEF 002989
AKL 002899

So this way I see a new version gets catalogued. Now I need a final process which summarizes them on a daily basis by reading all the available version. So Looking at the 1st two versions it should have below result.

ABC 002345 002300
DEF 002965 002989
AKL 002878 002899

So everyday with an additional GDG version I should see one more extra column gettting added. The number of rows on every GDG is fixed. In this case its 3. The number of coumn is also fixed. Onlt the value on the 2nd column varies and the 1st column is a key and remain fixed on every GDG version.

Is there a way to do it on GDGs ?? If so how ??
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: Mon Nov 26, 2007 9:42 am    Post subject:
Reply with quote

Hello Krushna Maharana and welcome to the forums,

What should happen on days when the process does not run (this will happen and needs to be planned for)?

When should happen if the process runs more than once on a given day (this may or may not happen depending on how missing and/or extra runs are needed)?

Might the record creation be changed to include the day-of-month as a data field?
Back to top
View user's profile Send private message
Krushna Maharana

New User


Joined: 25 Nov 2007
Posts: 3
Location: Weston, FL

PostPosted: Mon Nov 26, 2007 9:51 am    Post subject:
Reply with quote

No the process would run everyday for sure on a fixed time.

The process would run only once a day.

Yeh that can be done to have an date field in one of the records.

Do you have any solution in mind ??
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: Mon Nov 26, 2007 8:26 pm    Post subject:
Reply with quote

Hello,

Quote:
Do you have any solution in mind ??
Possibly.

If the records can be changed to include the "day", you won't need to work around how many generations to use. You can read the entire gdg base and control printing and summing by the day in the reocrds.

Quote:
the process would run everyday for sure on a fixed time.
The process can be scheduled to run every day at the same time, but there almost certainly will be an occasion when the job is not run on some day. These things do happen and are usually more likely when there has been no plan made to handle them.

If you use the gdg base as input, the problem pretty much goes away.
Back to top
View user's profile Send private message
Krushna Maharana

New User


Joined: 25 Nov 2007
Posts: 3
Location: Weston, FL

PostPosted: Mon Nov 26, 2007 8:58 pm    Post subject: Reply to: Merging GDG versions bases on a Key field
Reply with quote

May be you didnt understand the need. My need was to merge the available GDGs to a single file based on a key field. Is there a way to do it. I know we can do it by ICETOOL for two files but then I dont know how do we do it when we have multile versions on a GDG.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Nov 26, 2007 10:21 pm    Post subject:
Reply with quote

Krushna,

Well, it's a bit tedious, but you can use a DFSORT/ICETOOL job like the following. I show four files, but you can extend that to more.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN01 DD DSN=...  input file1
//IN02 DD DSN=...  input file2
//IN03 DD DSN=...  input file3
//IN04 DD DSN=...  input file4
...
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...   output file
//TOOLIN DD *
COPY FROM(IN01) TO(T1) USING(CTL1)
COPY FROM(IN02) TO(T1) USING(CTL2)
COPY FROM(IN03) TO(T1) USING(CTL3)
COPY FROM(IN04) TO(T1) USING(CTL4)
...
SPLICE FROM(T1) TO(OUT) ON(1,3,CH) -
  WITHEACH WITH(16,6) WITH(25,6) WITH(34,6) ...
/*
//CTL1CNTL DD *
  INREC OVERLAY=(300:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,3,16:7,6,300:X)
/*
//CTL3CNTL DD *
  INREC BUILD=(1,3,25:7,6,300:X)
/*
//CTL4CNTL DD *
  INREC BUILD=(1,3,34:7,6,300:X)
/*
...
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: Mon Nov 26, 2007 10:24 pm    Post subject:
Reply with quote

Hello,

Quote:
May be you didnt understand the need.
And maybe i did. . .

Quote:
My need was to merge the available GDGs to a single file based on a key field.
Not necessarily. I believe your need is to get the correct output.

You chose to use "merge". Your requirement may be better met by passing a single file and creating the needed output. If nothing else, it could remove a lot of unnecessary complexity.
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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


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