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 

Creating GDG file with record count

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Sep 28, 2005 6:39 am    Post subject: Creating GDG file with record count Reply with quote

Hi,

I have a GDG file for which I need to create a count file. The count file name should contain the name of the GDG file with the no. of records present in the GDG file. For eg: If the GDG file name is PROD.ASOS030Z.NEWNVDR.OUT.G1328V00 and if it has 289 records, then the count file should be created in the following format with all the records copied from the old file to the new file:

PROD.ASOS030Z.NEWNVDR.OUT.G1328V00.289.

Please let me know how to achieve this.

Is it possible to create a new version of the GDG itself with the record count? If so how?
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 28, 2005 6:52 am    Post subject: Reply with quote

Vkphani,

There are a couple of problems with your approach.

1. You cannot create a DATASET with a node which starts with a numeric. So you cannot have the numeric count as one of the node. you need to have a alphanumeric variable

i.e
Quote:

PROD.ASOS030Z.NEWNVDR.OUT.G1328V00.C289.


2. Once you create the GDG like this, you are de-linking the gdg generation from the base. your generations are no way linked to the base and treated as normal sequential datasets.

3. What happens if the count exceeds 7 digits?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Sep 28, 2005 7:37 am    Post subject: Reply with quote

Must be the homework problem de jour. I've seen this posted everywhere.
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Sep 28, 2005 7:44 am    Post subject: Reply with quote

Hi Kolusu,

Regarding Q1, the file can be created as
Quote:

PROD.ASOS030Z.NEWNVDR.OUT.G1328V00.C289


Reg Q2,Yes these files will become normal PS files.

Reg Q3, the count will not exceed 7 digits.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Sep 28, 2005 8:16 am    Post subject: Reply with quote

Vkphani,

The following JCL will give you the desired results. A brief explanation of the JOb. we dynamically create a new job to create a new dataset with a node to have count of the dataset and submit to the intrdr.

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYMNAMES DD *                                           
GDG,C'PROD.ASOS030Z.NEWNVDR.OUT.G1328V00'                 
//SYSOUT    DD SYSOUT=*                                   
//SORTIN    DD DSN=PROD.ASOS030Z.NEWNVDR.OUT.G1328V00,
//             DISP=SHR
//SORTOUT   DD SYSOUT=*                                   
//SYSIN     DD *                                         
  SORT FIELDS=COPY                                       
  OUTREC FIELDS=(SEQNUM,7,ZD,80:X)                       
  OUTFIL REMOVECC,NODETAIL,                               
  TRAILER1=(C'//USERIDSZ JOB ',                           
            C'''',                                       
            C'CREATE DSN',                               
            C'''',                                       
            C',',/,                                       
            C'//',13X,C'CLASS=A,',/,                     
            C'//',13X,C'MSGCLASS=Y,',/,                   
            C'//',13X,C'MSGLEVEL=(1,1),',/,               
            C'//',13X,C'NOTIFY=&SYSUID',/,               
            C'//*',/,                                     
            C'//STEP0100 EXEC PGM=SORT',/,               
            C'//SYSOUT   DD SYSOUT=*',/,                 
            C'//SORTIN   DD DSN=',GDG,C',',/,             
            C'//            DISP=SHR',/,                 
            C'//SORTOUT  DD DSN=',GDG,C'.C',1,7,C',',/,   
            C'//            DISP=(NEW,CATLG,DELETE),',/, 
            C'//            UNIT=SYSDA,',/,               
            C'//            SPACE=(CYL,(X,Y),RLSE)',/,   
            C'//SYSIN    DD *',/,                         
            C'  SORT FIELDS=COPY',/,                     
            C'//*',80:X)                                 
/*


The output of the above step is as follows:

Code:

//USERIDSZ JOB 'CREATE DSN',                                   
//             CLASS=A,                                         
//             MSGCLASS=Y,                                     
//             MSGLEVEL=(1,1),                                 
//             NOTIFY=&SYSUID                                   
//*                                                             
//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=PROD.ASOS030Z.NEWNVDR.OUT.G1328V00,           
//            DISP=SHR                                         
//SORTOUT  DD DSN=PROD.ASOS030Z.NEWNVDR.OUT.G1328V00.C0000289, 
//            DISP=(NEW,CATLG,DELETE),                         
//            UNIT=SYSDA,                                       
//            SPACE=(CYL,(X,Y),RLSE)                           
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
//*                                                             


Once you think the generated JCL is correct, change the following statement in the JCL

Code:

//SORTOUT   DD SYSOUT=* 


to

Code:

//SORTOUT   DD SYSOUT=(*,INTRDR)


The generated JCl will be submitted via INTRDR and creates the Dataset with the count as one of the node.

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
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Sep 28, 2005 8:27 am    Post subject: Reply with quote

vkphani,

The other way to create a filename dynamically is to create a dataset with some name and then use IDCAMS RENAME to rename the GDG version to the new name.

Use SORT or COBOL or any other programming language or tool to create the IDCAMS controlcard dynamically. This dynamic control card will then be passed to the next step which will be IDCAMS.

This way you can accomplish the result in just 1 job.

I think a similar post is already availbale in this forums. My system is tooooo slow now. We are doing some performance testing over our servers. Soooo...Please search and let me know.

Thanks,
Phantom
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Sep 28, 2005 8:43 am    Post subject: Reply with quote

Hi Kolusu and Phantom,

Thanks a lot for your replies and help.
Actually this question was asked by one of my collegue and that guy was given with this task to create the files.
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed Sep 28, 2005 9:00 am    Post subject: Reply with quote

Hi Kolusu,

I ran the job.
It is working fine.
Ultimate solution boss.
Thanks a lot for the help.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities 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