Posted: Mon Oct 11, 2004 7:51 am Post subject: Selective Creation of a GDG
Hi,
I have to achieve the following functionality.
1. Read a PS file. (There will be a number in the first Record of this PS file).
2. I need to write the contents of the PS file into next version of corresponding GDG.
PS contents are here -
H02XXXXXXX
DABCDEFGH
DABCDEFGH
GDGs are (These are Base Versions of GDG)
HLQ1.BM.GDG1
HLQ1.BM.GDG2
HLQ1.BM.GDG3
Now, Since in PS file '02' is there I need to create a new version of HLQ1.BM.GDG2.
I have a code in SELCOPY, which reads the first record of PS, and depending on that it will write the contents of PS to the particular GDG.
Selcopy (Logic of Selcopy am planning to write)
Code:
//STEP040 PGM=SELCOPY
//INPUT1 DD DSN=HLQ1.BM.INPUT1, DISP=SHR
//OUTPUT1 DD DSN=HLQ1.BM.GDG1(+1),DISP=(NEW,CATLG,DELETE)
//OUTPUT2 DD DSN=HLQ1.BM.GDG2(+1),DISP=(NEW,CATLG,DELETE)
....
//OUTPUT30 DD DSN=HLQ1.BM.GDG30(+1),DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
READ INPUT
IF NUMBER = 1
OUTDD=OUTPUT1
ELSE IF NUMBER=2
OUTDD=OUTPUT2
......
......
ENDIF
WRITE contents in OUTDD.
Now, It will work fine. But disadvantage is all other GDG versions it will create empty versions, which I don't want.
Here my Question is, If the number is 'X' in PS file, I want to write to the new version of 'X'GDG. Rest other GDGs versions should not be affected.
Please suggest me how can I achieve this with less effort.
I have all SORT,EZYTRIEVE and SELCOPY in my shop.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Oct 11, 2004 8:14 am Post subject:
Siva,
It is a very simple task. Generate a dynamic JCL and submit the JCL via Intrdr to copy the contents of the seq file.
The following JCL will give you the desired results. First we read the first record of the PS file. Now using a change command on the outrec fields, we change the number to corresponding file number. And using OUTFIL OUTREC we create a dynamic JCL.
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