I need to split the input file (VB 100) into 'n' different output files (VB 100).
But the catch here is that I only know that the keyfield is @ column (1,7). I have no idea what the key values are.
Based on keyvalue present in column (1,7) I need to split the files.
One this is for sure that the not more than 10 different keyvalues in Column 1,7 will be there in the input file. There can be thousands of records for each key value.
Input File:
Code:
----+----1----+----2----+----3----+----4----
***************************** Top of Data *******
AAA1111 sdfasdfsdfsdf
AAA1111 fdfsdfsdfsd
AAA1111 dfasf sdsd
AAA2222 fsdasd
AAA2222 fadffaf
AAA2222 zxcvafsdfds
BBB1111 423rsfsdafsdaf
BBB1111 sdfasdfsdfsdf
BBB1111 fdfsdfsdfsd
BBB3333 dfsfsda sdsd
BBB3333 fsdasd
BBB3333 fadfsdfsdafsd
BBB3333 zxcvafsdfds fd
**************************** Bottom of Data *****
Output Files:
Code:
----+----1----+----2----+----3----+----4----+----5
***************************** Top of Data ********
AAA1111 sdfasdfsdfsdf
AAA1111 fdfsdfsdfsd
AAA1111 dfasf sdsd
**************************** Bottom of Data ******
Code:
----+----1----+----2----+----3----+----4----+----5
***************************** Top of Data ********
AAA2222 fsdasd
AAA2222 fadffaf
AAA2222 zxcvafsdfds
**************************** Bottom of Data ******
Code:
----+----1----+----2----+----3----+----4----+----5
***************************** Top of Data ********
BBB1111 423rsfsdafsdaf
BBB1111 sdfasdfsdfsdf
BBB1111 fdfsdfsdfsd
**************************** Bottom of Data ******
Code:
----+----1----+----2----+----3----+----4----+----5
***************************** Top of Data ********
BBB3333 dfsfsda sdsd
BBB3333 fsdasd
BBB3333 fadfsdfsdafsd
BBB3333 zxcvafsdfds fd
**************************** Bottom of Data ******
Is it possible to split a file without knowing the keyvalue or the number records to be split ?
if the output dsname is irrelevant and You bear some empty datasets
You can do it in one pass
( since You say that there will be no more than 10 keys )
see here for a snippet ( just change the key accordingly )
www.ibmmainframes.com/viewtopic.php?t=55695&highlight=split
but if on the other side the output dsname MUST relate to the <key>
and You NEED to create the exact number of datasets
You will have to use a two pass approach
pass1 <scan> the input to determine the keys and GENERATE/SUBMIT the
pass2 job that will do the splitting
note...
if the key can be used as a dataset qualifier the key can be up to 8 chars
otherwise it must be at max 7 to prefix it with a <letter> to make it a valid qualifier
Thats exactly what I needed.
Though my current requirement doesn't need "exact number of datasets" or "datasets with the key as part of the dsname", I will try to implement it using intrdr.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Vamshi Veludandi,
Since your input can only have a max of 10 datasets I suggest that you hard code the DSN names and later on delete them if they are empty. Use the following DFSORT JCL which will give you the desired results