View previous topic :: View next topic
|
Author |
Message |
sakthi16
New User
Joined: 12 May 2008 Posts: 13 Location: India
|
|
|
|
Hi,
I have requirement to read a single file and to create 'N' number of files based on field.
if a new fields comes today then i need to store it for future processing. how can i do this?
can anyone help me on this ? |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
Write a Cobol, PL/I or REXX program and dynamically allocate the files.
You cannot do this with just JCL! |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Looks homework assignment to me... |
|
Back to top |
|
|
sakthi16
New User
Joined: 12 May 2008 Posts: 13 Location: India
|
|
|
|
Ya. We can not do this with just a JCL, can any one try to provide a best possible solution ?
Here the problem is Im handling a Variable length file.
the field mared in bold is the condition field.
For ex,
Input file
HDR
DSTART1AABBCCT5
DATA2BBCCRRR
DEND
DSTART1AABBCCT2
DATA2BBCCRRR
DEND
DSTART1AABBCCT5
DATA2BBCCRRR
DEND
DSTART1AABBCCT1
DATA2BBCCRRR
DEND
DSTART1AABBCCT2
DATA2BBCCRRR
DEND
LET
Output file
In this case we have three output files
first file
HDR1
DSTART1AABBCCT5
DATA2BBCCRRR
DEND
DSTART1AABBCCT5
DATA2BBCCRRR
DEND
LET
second file
HDR1
DSTART1AABBCCT2
DATA2BBCCRRR
DEND
DSTART1AABBCCT2
DATA2BBCCRRR
DEND
LET
third file
HDR1
DSTART1AABBCCT1
DATA2BBCCRRR
DEND
LET
but the condition field can have any value, we have to group the files using the condition field. and need to create 'N' number of output files based on this...
so, output files can be 1 or it can be many every day....
can any one help ????? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
This would be a good application for your sort tool (DFSORT or Syncsort - we obviously don't know which one you have). It could read your data, determine how many output DD's will be needed and maybe create a series of dynamic names and allocation statements, then format and arrange the data. Then, a set of proper DD and SORT statements could be written out and stored.
Then, your next job could use those details to perform the actual split.
Or, as already stated, you could do this programatically. A lot depends on what's acceptable to you and your shop and how you want to implement this.
There was a very similar topic posted here. |
|
Back to top |
|
|
|