Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Header to differentiate each copied file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Header to differentiate each copied file
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    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Jul 02, 2008 7:54 pm    Post subject: Reply to: Header Problem.
Reply with quote

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

http://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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 03, 2008 1:18 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 03, 2008 7:35 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 03, 2008 9:58 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Fri Jul 04, 2008 5:20 pm    Post subject: Reply to: Header to differentiate each copied file
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us