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

Creating 'N' number of files dynamically


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

New User


Joined: 12 May 2008
Posts: 13
Location: India

PostPosted: Thu Apr 14, 2011 2:27 am
Reply with quote

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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Apr 14, 2011 2:30 am
Reply with quote

Write a Cobol, PL/I or REXX program and dynamically allocate the files.

You cannot do this with just JCL!
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Apr 14, 2011 2:56 am
Reply with quote

Looks homework assignment to me...
Back to top
View user's profile Send private message
sakthi16

New User


Joined: 12 May 2008
Posts: 13
Location: India

PostPosted: Thu Apr 14, 2011 3:19 am
Reply with quote

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

Global Moderator


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

PostPosted: Thu Apr 14, 2011 3:50 am
Reply with quote

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
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top