How to access creation date of PS file in a JCL program?



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to access creation date of PS file in a JCL program?

Postby skankatala » Sun Dec 11, 2011 9:52 am

I have a GDG version. Every day there are files created in my GDG. I have to copy all those newly created versions onto Tape. Can I do this throgh JCL?

Exact requirement in simple words...

If i gave the GDG base and date as input, i should get a copy of all those files into tape. Please help me out?

Thanks in advance.
skankatala
 
Posts: 42
Joined: Sun Dec 11, 2011 9:45 am
Location: Hyderabad
Has thanked: 0 time
Been thanked: 0 time

Re: How to access creation date of PS file in a JCL program?

 

Re: How to access creation date of PS file in a JCL program?

Postby steve-myers » Sun Dec 11, 2011 10:25 am

skankatala wrote:I have a GDG version. Every day there are files created in my GDG. I have to copy all those newly created versions onto Tape. Can I do this throgh JCL?

Exact requirement in simple words...

If i gave the GDG base and date as input, i should get a copy of all those files into tape. Please help me out?

Thanks in advance.
And what does this have to do with obtaining the creation date of a sequential dataset?
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: How to access creation date of PS file in a JCL program?

Postby dick scherrer » Sun Dec 11, 2011 11:18 am

Hello,

And what does this have to do with obtaining the creation date of a sequential dataset?
I suspect the creation date is needed to determine which generations are to be copied.

One way would be to run an IDCAMS LISTCAT and determine which have been created on the desired date, then use these genrations for the process.

Another way is to catalog each new generation as it is created. The other process to use the data would read all active generations and delete them when the process completes (leaving the gdg with no active generations). If they needed to be retained, make a copy of them before the process runs.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to access creation date of PS file in a JCL program?

Postby NicC » Sun Dec 11, 2011 11:33 am

I have a GDG version

What do you mean by this? You are mixing various terms.
Can I do this throgh JCL?

Why not - almost everything on the mainframe runs because it has JCL - batch jobs, TSO, CICS, IMS etc.

Are you talking about one GDG base or several? Is one generation created per run or several.
NOTE: there is nothing magical about a GDG - it is just an ordinary dataset of its type with a special naming convention.

You have several options:
1 - If you create one new dataset per base per run then your backup control cards could specify generation (0) - may depend on what backup software you use
2 - instead of creating the datasets as GDGs at the start you can crete them with temporary names, back these up and then copy them to their (+1) names.
3 - If you have multiple datasets per GDG per run then you could run a LISTCAT and parse the output to generate the backup control cards. There are several topics on this in the forums.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: How to access creation date of PS file in a JCL program?

Postby skankatala » Sun Dec 11, 2011 3:27 pm

NicC wrote:
I have a GDG version

What do you mean by this? You are mixing various terms.
Can I do this throgh JCL?

Why not - almost everything on the mainframe runs because it has JCL - batch jobs, TSO, CICS, IMS etc.

Are you talking about one GDG base or several? Is one generation created per run or several.
NOTE: there is nothing magical about a GDG - it is just an ordinary dataset of its type with a special naming convention.

You have several options:
1 - If you create one new dataset per base per run then your backup control cards could specify generation (0) - may depend on what backup software you use
2 - instead of creating the datasets as GDGs at the start you can crete them with temporary names, back these up and then copy them to their (+1) names.
3 - If you have multiple datasets per GDG per run then you could run a LISTCAT and parse the output to generate the backup control cards. There are several topics on this in the forums.



Thanks for your response NicC.

I have a GDG version

I am sorry for this confusion.

I have a GDG. Our processing system generates new versions everyday. I have to take the backup of all the created versions into tape.

Can i do this through JCL?


It means, can the JCL itself satisfy my requirement, or do I need to use Cobol?
skankatala
 
Posts: 42
Joined: Sun Dec 11, 2011 9:45 am
Location: Hyderabad
Has thanked: 0 time
Been thanked: 0 time

Re: How to access creation date of PS file in a JCL program?

Postby BillyBoyo » Sun Dec 11, 2011 4:02 pm

Versions are the V00 bit of the dataset name. They don't usually change. For any Generation (the Gnnnn bit) there is only one version at a time. So you have new Generations on a daily basis.

Worth checking with your storage people and see how they'd like to do it?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to access creation date of PS file in a JCL program?

Postby skankatala » Sun Dec 11, 2011 4:10 pm

skankatala wrote:
NicC wrote:
I have a GDG version

What do you mean by this? You are mixing various terms.
Can I do this throgh JCL?

Why not - almost everything on the mainframe runs because it has JCL - batch jobs, TSO, CICS, IMS etc.

Are you talking about one GDG base or several? Is one generation created per run or several.
NOTE: there is nothing magical about a GDG - it is just an ordinary dataset of its type with a special naming convention.

You have several options:
1 - If you create one new dataset per base per run then your backup control cards could specify generation (0) - may depend on what backup software you use
2 - instead of creating the datasets as GDGs at the start you can crete them with temporary names, back these up and then copy them to their (+1) names.
3 - If you have multiple datasets per GDG per run then you could run a LISTCAT and parse the output to generate the backup control cards. There are several topics on this in the forums.


Everyday new generations will create not the versions. Can i take backup of all the generations of a particular date and how?

Thanks for your response NicC.

I have a GDG version

I am sorry for this confusion.

I have a GDG. Our processing system generates new versions everyday. I have to take the backup of all the created versions into tape.

Can i do this through JCL?


It means, can the JCL itself satisfy my requirement, or do I need to use Cobol?
skankatala
 
Posts: 42
Joined: Sun Dec 11, 2011 9:45 am
Location: Hyderabad
Has thanked: 0 time
Been thanked: 0 time

Re: How to access creation date of PS file in a JCL program?

Postby BillyBoyo » Sun Dec 11, 2011 7:13 pm

OK, no, JCL itself cannot satisfy the requirement. No, you do not need to use Cobol.

You have at your site some technical people who look after storage, some other who look after production runs and data, and others who do various things without which the machine would never run.

Go to some of these people. If your datasets are testing of some sort, as them for some suggestions about how to do it. If you get nowhere, come back here and we'll find some. If it is production data, they will tell you how to do it, or even tell you not to do it as it might be considered to be their job and not yours, and laugh at the idea that we can suggest anything to you without knowing your site's standards.

Beyond this and with the "information" you have provided, I don't know what else to say.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to access creation date of PS file in a JCL program?

Postby skankatala » Sun Dec 11, 2011 7:26 pm

BillyBoyo wrote:OK, no, JCL itself cannot satisfy the requirement. No, you do not need to use Cobol.

You have at your site some technical people who look after storage, some other who look after production runs and data, and others who do various things without which the machine would never run.

Go to some of these people. If your datasets are testing of some sort, as them for some suggestions about how to do it. If you get nowhere, come back here and we'll find some. If it is production data, they will tell you how to do it, or even tell you not to do it as it might be considered to be their job and not yours, and laugh at the idea that we can suggest anything to you without knowing your site's standards.

Beyond this and with the "information" you have provided, I don't know what else to say.



We work from offshore. We don't have any choice to meet those people. I have access to write and run a JCL. I got the above requirement and i have to do it, either in JCL or in Cobol. I can write JCLs, but can't write COBOL programs. So, I am planning to complete it in JCL. Please guide me to complete this requirement. For your info... We run jobs in Test region, we snt have access to production.
skankatala
 
Posts: 42
Joined: Sun Dec 11, 2011 9:45 am
Location: Hyderabad
Has thanked: 0 time
Been thanked: 0 time

Re: How to access creation date of PS file in a JCL program?

Postby BillyBoyo » Sun Dec 11, 2011 8:06 pm

OK, if you can't write Cobol I'd rule that one out anyway. Never much of a front-runner.

If you do a LISTCAT of your GDG (that's with some JCL with EXEC PGM=IDCAMS) you'll get some listing output showing you information about all the datasets belonging to your GDG. You will be able to see which ones you need.

When you say you need them on tape, how do you need them? Seperate datasets? Or all the data together as one dataset?

You could start with a visual/manual process (you run the LISTCAT, look at the output, amend for that day's data) and then consider how to automate it.

What do you need to do with the data afterwards? Are you actually "backing-up" the data, or do you want to be able to use it directly?

Even if you can't visit the technical people, are you allowed to make a 'phone call, or send an e-mail?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post