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
 

 

How to concatenate gdgs

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

New User


Joined: 14 Jul 2007
Posts: 3
Location: bangalore

PostPosted: Fri Jul 20, 2007 1:34 pm    Post subject: How to concatenate gdgs
Reply with quote

how to concatenate gdgs..explain with example..
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jul 20, 2007 1:47 pm    Post subject:
Reply with quote

Deepa,

What do you want ot do? Concatenate generation of same gdg or different gdg's?
Back to top
View user's profile Send private message
ratheesh_1983

New User


Joined: 11 Apr 2007
Posts: 19
Location: hyderabad

PostPosted: Fri Jul 20, 2007 1:54 pm    Post subject:
Reply with quote

Hi deepa,

check out this link and see whether u get the answer?

http://ibmmainframes.com/post-5375.html&highlight=

icon_smile.gif

regards
ratheesh
Back to top
View user's profile Send private message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Fri Jul 20, 2007 5:47 pm    Post subject: Re: How to concatenate gdgs
Reply with quote

Hi Deepa,

Here is how we are concatanating files in our shop.

Here is the code block

//S014 EXEC MSSORT,MODE=TEST
//SORTIN DD DSN=STA415.ME204D0.LOST(0),DISP=SHR
// DD DSN=STA415.ME204D0.LOST(-1),DISP=SHR
// DD DSN=STA415.ME204D0.LOST(-2),DISP=SHR
// DD DSN=STA415.ME204D0.LOST(-3),DISP=SHR
// DD DSN=STA415.ME204D0.LOST(-4),DISP=SHR
//SORTOUT DD DSN=STA415.ME204D0.CUSACCT.EXTRACT.LT,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jul 25, 2007 10:24 am    Post subject:
Reply with quote

monasu1998,

Just a quick question, what'll you do if you have more no. of GDGs, say 100, how'll you concatenate them, same way you showed above?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2007 3:01 pm    Post subject: Re: Hi
Reply with quote

Hi & Welcome to forums,

Hopefully I understand your post...
vrmohan7 wrote:
what monasu1998 is that work ...let me know ..i think it for NON.GDG file like PS file

you want to know: Whether the code given by monasu1998 will work or not? If it works, is it similar to the concatenation of PS (QSAM)?

If above then, Yes the code'll work & it is similar to concatenation of PS (QSAMs).
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Thu Jul 26, 2007 3:22 pm    Post subject:
Reply with quote

Yep.
You are correct, When you give base GDG, it will take all the generations present !!!
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2007 3:48 pm    Post subject: Re: How to concatenate gdgs
Reply with quote

vrmohan7 wrote:
yes. ...it work ps file concatenate ...i think for GDG ...we have just to give one master file ....in dsn ..is not that enough!

Hi,

If by "master file" you mean the GDG Base then you are right.
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Thu Jul 26, 2007 5:24 pm    Post subject:
Reply with quote

Yes,

The code what monasu1998 Posted works fine.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 26, 2007 9:31 pm    Post subject: Re: How to concatenate gdgs
Reply with quote

vrmohan7 wrote:
then what about monasu1998 code for concatenation for GDG is that work for GDG!.. let me know ..

Hi,
Here I think the definition of GDG will serve better:
GDG = Generation Data Group is a collection of historically related non-VSAM data sets that are arranged in chronological order; each data set is known as a generation data set.

By definition GDGs are chronologically related Data sets or PS files or DSNs, so the code in question will work, as suggested. But if you have more no. of GDGs, given code is not advisable; in that case, way you are suggesting is better.
Back to top
View user's profile Send private message
sukanya-ramanathan

New User


Joined: 07 Apr 2007
Posts: 8
Location: Hyderabad

PostPosted: Sun Jul 29, 2007 10:15 am    Post subject:
Reply with quote

Please advice if the below code is fine...

//S014 EXEC MSSORT,MODE=TEST
//SORTIN DD DSN=STA415.ME204D0.LOST,DISP=SHR
//SORTOUT DD DSN=STA415.ME204D0.CUSACCT.EXTRACT.LT,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*

where STA415.ME204D0.LOST is a GDG base.

Regards,
Sukanya
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jul 31, 2007 10:26 am    Post subject:
Reply with quote

Sukanya,

Code will work, however, you need to change the DISP of SORTOUT. It should not be DISP=SHR.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jul 31, 2007 12:48 pm    Post subject: Re: hi Sukanya,
Reply with quote

vrmohan7 wrote:
i don't think in this matter disp play role ...as it should be same disp =shr only
Hi,

SHR in DISP indicates that the data set existed prior to this job step and that another job can share it while this job step uses it.

If SORTOPUT, in above JCL, is a new DSN, you would go for DISP=(NEW,CATLG,DELETE)

Further, if data set existed prior to this job step better to use DISP=OLD. Why should invite others to put my job on hold?

I would not like another user/JOB to use this dataset till my SORT job is over. That's why I said 'should not be', if you are sure that no job/user will use this SORTOUT dataset till your JOB ends, go ahead with DISP=SHR.
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 Jul 31, 2007 8:29 pm    Post subject:
Reply with quote

Hello,

You do not want SHR for your output dataset.

You cannot have your job writing to the file while some other user is trying to use it.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Aug 01, 2007 12:41 pm    Post subject: Re: How to concatenate gdgs
Reply with quote

vrmohan7 wrote:
yes, you are correct dis = shr mean it share by other ..and mod is if not there it will creat & old is exclusive control to pds ..but what i like to know ...if you pds or psd in sort out ..i mean above code ..the output dataset ..is used by someother job...then what will case of disp then...let me know pls
tks
Hi,

I couldn't get your post clearly. What is psd in
Quote:
...if you pds or psd in sort out ..
?
Does 'psd' mean 'Physical Sequential Dataset' loosely used for QSAM Data sets?
If so, Dick suggestion should suffice for your query:
dick scherrer wrote:
You cannot have your job writing to the file while some other user is trying to use it.

If your query is something else, please let us know.
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: Fri Aug 03, 2007 12:34 am    Post subject:
Reply with quote

Hello,

If you are creating a new datasets to go to other applications, i recommend that all of them be DISP=(NEW,CATLG,DELETE) - unless there is some reason to preserve datasets created in an abended execution.

If you are creating new members in some existing partioned dataset(s) - PDS, the jcl should use DISP=SHR.
Back to top
View user's profile Send private message
BalaMuraliL

New User


Joined: 01 Aug 2007
Posts: 10
Location: Pune

PostPosted: Fri Aug 03, 2007 12:48 am    Post subject:
Reply with quote

Hi Anuj,

As per the explanation to sukanya's question, could you please explain why you are suggesting to not put DISP=SHR ? If You mean, that is new data set then it is fine. If there are any other reasons please let me know. Thank You.
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: Fri Aug 03, 2007 12:59 am    Post subject:
Reply with quote

Hello,

Do NOT use SHR for the creation of a new dataset. It is not fine.

My previous reply post provides the info needed to create output datasets and/or members of a pds.
Back to top
View user's profile Send private message
BalaMuraliL

New User


Joined: 01 Aug 2007
Posts: 10
Location: Pune

PostPosted: Fri Aug 03, 2007 1:43 am    Post subject:
Reply with quote

Hi Sukanya,

Case 1:

If the GDG limit is 30 , and if you want to concatenate only last 10 generations then you can follow normal PS Concatination. i.e same mentioned as Monasu1998 coded.

Case 2 :

If the GDG limit is 30 and if you wnat to concatenate all the 30 generations then you no need to code as concatinate all the generations. you can mention the base GDG name bcoz, It will consiste all the generations. So, concatination concepts is not required in this case.

Case 3 :

If you have more than one GDG base clusters, and if you want to concatinate all the GDG base clusters, then you have to apply concatination concept like...
//STEP1 EXEC PGM=SORT
//SORTIN1 DD DSN=A.BASE.GDG1, DISP=SHR
// DD DSN=A.BASE.GDG2, DISP=SHR
// DD DSN=A.BASE.GDG3, DISP=SHR
// DD DSN=A.BASE.GDG4, DISP=SHR
//SORTOUT DD DSN=A.ALLGDGS.MASTER,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
//
In the Case 3 , all the GDG's must have same RECFM, LRECL and Output dataset also should have same RECFM, LRECL.
Hope this will help you . Thanks. If you have any queries please let me know.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Aug 03, 2007 10:33 am    Post subject:
Reply with quote

BalaMuraliL wrote:
As per the explanation to sukanya's question, could you please explain why you are suggesting to not put DISP=SHR ?
Hi,

Dick has given the answer of your query, still I'll try to satisfy you bit more.

BalaMuraliL wrote:
If You mean, that is new data set then it is fine.
Good, You are already agree for this. icon_smile.gif
BalaMuraliL wrote:
If there are any other reasons please let me know. Thank You.
Lets you have two JOBs - JOB1 & JOB2. JOB1 runs at, say, 10:20 & takes 5 minutes to complete & second JOB2 runs at 10:22 & it takes 1 minute to complete. Code for JOB1 is like(as shown by you in case 3 of your post):
Code:

//JOB1
//STEP1 EXEC PGM=SORT
//SORTIN1 DD DSN=A.BASE.GDG1, DISP=SHR
// DD DSN=A.BASE.GDG2, DISP=SHR
// DD DSN=A.BASE.GDG3, DISP=SHR
// DD DSN=A.BASE.GDG4, DISP=SHR
//SORTOUT DD DSN=A.ALLGDGS.MASTER,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*
//

& code for JOB2 is like, it makes use of SORTOUT, from JOB1, as it's input.
Code:

//JOB2
//STEP1 EXEC PGM=PGM1
//STEPLIB DD DSN=STEP.LIB
//INFILE DD DSN=A.ALLGDGS.MASTER,DISP=SHR
//OUTFILE DD DSN=THS.IS.OUTPUT, DISP=(NEW,CATLG,DELETE)
/*
//


Both the JOBs runs independent to each other i.e. they are sechduled to run on time(specified above). Now once the JOB1 is started, can you please tell me what'll happen to the output of JOB2 at 10:23?
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 Concatenate different LRECL GDG's Rohit Umarjikar DFSORT/ICETOOL 6 Wed Nov 18, 2015 3:30 am
No new posts Concatenate 2 different VB files to a... santhosh5983 DFSORT/ICETOOL 8 Sat Oct 10, 2015 2:12 am
No new posts How to make REXX process different GDGs? venksiv CLIST & REXX 15 Thu Sep 24, 2015 5:35 pm
No new posts How to concatenate a dataset with SYS... swathykrishnan CLIST & REXX 8 Tue Sep 01, 2015 6:08 pm
No new posts how to concatenate two cobol loadlib ... boyti ko CLIST & REXX 2 Mon Jun 29, 2015 4:41 pm


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