View previous topic :: View next topic
|
Author |
Message |
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
Hi
i have a GDG of 255 generations. I need to copy all the file to another file(single file) with some header to differentiate each copied file. The file layout is
State_id
Promo_id
promo_desc
promo_typ
each file may have records of single promotion or multiple promotion. the output file i need:
Quote: |
<header1>
rec11
rec12
...
<header2>
rec21
rec22
...etc
|
and the header should be
Quote: |
state_id: xx promo_id: xxxx creation_date(of input file):mmddccyy
|
The problem i have here is how to get creation_date into the header. i already wrote a simple COBOL program but that can only get state_id and promo_id. How do i get the creation date for all the GDG generations. |
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
In the jcl i have merged the all the generation
Code: |
//STEP002 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=GDG.BASE
//SORTOUT DD DISP=(,CATLG,DELETE),DSN=DPSDSNG.MERGE.DATA,
// DATACLAS=EXTMED,
// DCB=(LRECL=265,RECFM=FB)
//SYSIN DD *
SORT FIELDS=(1,2,ZD,A)
//*
//*
|
then use DPSDSNG.MERGE.DATA as input to run my cobol program. If any one have any idea as how to get creation date of the file please help me. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
yes. But that was for only individual file...now how to implement all the generations at once and get the date into output file... |
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
It does look similar but how to process individual generations, get the creation date and process that information with the COBOL pgm?
Thanks,
Santosh |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Maybe you should review the listcat suggestion from your other topic. As mentioned then, the sort you decided to use will give current-date and your requirement is creation date.
LISTCAT can give you the creation date for all of the datasets for the gdg base. There are ways to determine the dataset name being processed from within your cobol program (search in the forum, as i recall there is more than one soluton posted). You would need to match the dataset name being read against the list of datasets retrieved via listcat and then you would have the creation date for each file.
If you really believe this is a requirement, it is available, but you will need to do more work to implement. |
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
Quote: |
You would need to match the dataset name being read against the list of datasets retrieved via listcat and then you would have the creation date for each file.
|
Yes, i understood what you said but implementing it a bit difficult.
you mean that i put all 255 generation as input for my cobol pgm? and how to match the dataset name and that of the LISTCAT within the cobol pgm?
Quote: |
There are ways to determine the dataset name being processed from within your cobol program (search in the forum, as i recall there is more than one soluton posted).
|
i'll do some research in this forum...but if you have the link as where is it was posted please provide me that!
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Read the LISTCAT output in your cobol program and create an array of all of the generations found by the listcat with their creation date.
As your program reads all of the generations in a single pass, find which generation is currently being processed (in the array) and use the creation date at that place in the array. |
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
Quote: |
As your program reads all of the generations in a single pass, find which generation is currently being processed (in the array) and use the creation date at that place in the array.
|
i have a question here. when i read GDG generation how would the cobol program know which generation it is processing now so as to cross check in the table to get the corresponding creation date?
Quote: |
reads all of the generations in a single pass
|
that means to give the GDG base name as input to the program?
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i have a question here. when i read GDG generation how would the cobol program know which generation it is processing now so as to cross check in the table to get the corresponding creation date? |
Look at your other topic on how to detect which file is being read.
As i've mentioned multiple times now, this will be considerably more work for you.
Quote: |
that means to give the GDG base name as input to the program? |
Yes, use the gdg base name on the DD statement for the file. If you mention only the base name, all gnerations will be read. |
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
i was expecting a little bit more description or example for more work or how to initiate that work.
anyways thanks for the help.
Thanks,
Santosh |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
it all depends on how You want Your jcl built....
the simplest JCL would concatenate in a single input all Your input datasets,
but then You would lose track of dataset change
on the other side if You want to keep track of the single datasets
You must have a single dsname allocated to each dd...
but, by grace, for what business reason You need to accumulate in such a way?
doesn' t each dataset have something inside to distinguish it from the other ones
wouldn' t a dfdss job take care of the backup in a simpler way? |
|
Back to top |
|
|
gskn4u Currently Banned New User
Joined: 29 Feb 2008 Posts: 25 Location: hyderabad
|
|
|
|
Quote: |
You must have a single dsname allocated to each dd...
|
i have about 190 generation...so do i need to put all the generation as input...
Quote: |
doesn' t each dataset have something inside to distinguish it from the other ones
|
promo_id is uniques but the problem is if two file have same promo_id.
let check with dfdss... |
|
Back to top |
|
|
|