View previous topic :: View next topic
|
Author |
Message |
deepam25
New User
Joined: 14 Jul 2007 Posts: 3 Location: bangalore
|
|
|
|
how to concatenate gdgs..explain with example.. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Deepa,
What do you want ot do? Concatenate generation of same gdg or different gdg's? |
|
Back to top |
|
|
ratheesh_1983
New User
Joined: 11 Apr 2007 Posts: 19 Location: hyderabad
|
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Yep.
You are correct, When you give base GDG, it will take all the generations present !!! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
kgumraj
Active User
Joined: 01 May 2006 Posts: 151 Location: Hyderabad
|
|
|
|
Yes,
The code what monasu1998 Posted works fine. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
sukanya-ramanathan
New User
Joined: 07 Apr 2007 Posts: 8 Location: Hyderabad
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Sukanya,
Code will work, however, you need to change the DISP of SORTOUT. It should not be DISP=SHR. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
BalaMuraliL
New User
Joined: 01 Aug 2007 Posts: 10 Location: Pune
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
BalaMuraliL
New User
Joined: 01 Aug 2007 Posts: 10 Location: Pune
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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.
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 |
|
|
|