IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Header to differentiate each copied file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Wed Jul 02, 2008 7:47 pm
Reply with quote

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
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Wed Jul 02, 2008 7:53 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jul 02, 2008 7:54 pm
Reply with quote

Didn't we already go over this in your previous topic?

www.ibmmainframes.com/viewtopic.php?t=32041&highlight=
Back to top
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Wed Jul 02, 2008 7:58 pm
Reply with quote

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
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Wed Jul 02, 2008 8:08 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 03, 2008 1:18 am
Reply with quote

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
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Thu Jul 03, 2008 2:13 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 03, 2008 7:35 pm
Reply with quote

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
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Thu Jul 03, 2008 8:53 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 03, 2008 9:58 pm
Reply with quote

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
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Fri Jul 04, 2008 4:54 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jul 04, 2008 5:20 pm
Reply with quote

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
View user's profile Send private message
gskn4u
Currently Banned

New User


Joined: 29 Feb 2008
Posts: 25
Location: hyderabad

PostPosted: Fri Jul 04, 2008 6:01 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top