Now I want to sort the 3 files into 1 file with record length=36.
(a):If the record's INVEST_TYPE equals to '01', then add one byte 'S' as a leading indicator in the output file.
(b):If the record's INVEST_TYPE equals to '02', then add one byte 'L' as a leading indicator in the output file.
(c):If the record's INVEST_TYPE equals to '03', then add one byte 'O' as a leading indicator in the output file.
So my question is, is it possible to make this into reality by using DFSORT ?
I am wondering whether it's possible to get these 3 files record length in a control card so I can distinguish which file in then assign the correct leading indicator.
Now I want to sort the 3 files into 1 file with record length=36.
(a):If the record's INVEST_TYPE equals to '01', then add one byte 'S' as a leading indicator in the output file.
(b):If the record's INVEST_TYPE equals to '02', then add one byte 'L' as a leading indicator in the output file.
(c):If the record's INVEST_TYPE equals to '03', then add one byte 'O' as a leading indicator in the output file.
So my question is, is it possible to make this into reality by using DFSORT ?
I am wondering whether it's possible to get these 3 files record length in a control card so I can distinguish which file in then assign the correct leading indicator.
What is the record layout/format of the final output file? Please provide which fields from all three files you want in the output file? Also provide where do you want to add leading indicator?
Do you have common key in all the 3 input files (FUND_ID and CLIENT_ID)?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
icetree521,
Cute kitten. Is it yours?
You need to do a better job of explaining what it is you're trying to do exactly before anyone can help you.
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. If file3 can have duplicates within it, show that in your example.
Joined: 04 Apr 2010 Posts: 13 Location: hangzhou, china
sqlcode1 wrote:
icetree521,
icetree521 wrote:
Now I want to sort the 3 files into 1 file with record length=36.
(a):If the record's INVEST_TYPE equals to '01', then add one byte 'S' as a leading indicator in the output file.
(b):If the record's INVEST_TYPE equals to '02', then add one byte 'L' as a leading indicator in the output file.
(c):If the record's INVEST_TYPE equals to '03', then add one byte 'O' as a leading indicator in the output file.
So my question is, is it possible to make this into reality by using DFSORT ?
I am wondering whether it's possible to get these 3 files record length in a control card so I can distinguish which file in then assign the correct leading indicator.
What is the record layout/format of the final output file? Please provide which fields from all three files you want in the output file? Also provide where do you want to add leading indicator?
Do you have common key in all the 3 input files (FUND_ID and CLIENT_ID)?
Thanks,
Hi sqlcode1,
Thanks first. There is no a common record layout for the final output file. Each record of the final output layout is just the same as what it gets from the input record, except that it has one byte leading indicator('S','L' or 'O') in the first byte.
For example,
I want the final output records like:
SAAAA;0001;01 ;
LAAAB;0002;200908013;02 ;
OAAAC;0001;OPTIONSEC;200702017;03 ;
which is in a format like: one leading indicator + input record format.
Please note the leading indicator is added in the beginning position. Both the 3 input files are begin with FUND_ID and CLIENT_ID, so (FUND_ID and CLIENT_ID) is the comment key.
Since the final output record length is 36, there will be 20 padding blanks for records from FILE01 and 10 padding blanks for records from FILE02.
Joined: 04 Apr 2010 Posts: 13 Location: hangzhou, china
Frank Yaeger wrote:
icetree521,
Cute kitten. :) Is it yours?
You need to do a better job of explaining what it is you're trying to do exactly before anyone can help you.
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example. If file3 can have duplicates within it, show that in your example.
Hi Frank Yaeger,
What a coincidence! You got a cute mouse and I got a cute kitten. :D
I hope i've made myself understood in the reply to sqlcode1.
icetree521,
Because, all 3 files have different LRECL,I would personally write Cobol program instead of DFSort. However, below is DFSort solution to achieve the same. I assumed if INVEST_TYPE is not among 01,02,03 then you want to populate space in leading char.