Page 1 of 1

Header date from a file and main data/trailer from another.

PostPosted: Fri Jun 14, 2013 4:58 am
by hsinaz
Can this be done completely in DFSORT or do I need to use ICETOOL?

I have a (batch processing) date that comes from one file that I need to put on my output header along with a bunch of constant literals. My detail records come from another file that I use to sort/sum on and then write them along with a trailer record showing the number of detail records. So Two input files, one output file with header, detail records and trailer.

I would like to do this completely in DFSORT but if it is complicated and solution is simpler in ICETOOL then I will use that. Please show me a quick example if possible. I already have two jobs that create the two separate output, one contains 1 line of header using the file that has my batch processing date in it. The other job create the detail sort/summed records and a trailer using mu main data file.

Thanks in advance
hsinaz.

Re: Header date from a file and main data/trailer from anoth

PostPosted: Fri Jun 14, 2013 12:30 pm
by BillyBoyo
Yes, it can be done easily and simply with DFSORT.

http://ibmmainframes.com/about58661.html

The first, very small, job step creates a DFSORT Symbol from your date file and writes it to a temporary dataset.

The second step them includes your SORT/SUM (or whatever) processing. In that step you have a DD for SYMNAMES, with the DSN of the temporary file created from the earlier step.

In the Sort Control Cards, you use the Symbol you have generated for whatever purpose you like.

Re: Header date from a file and main data/trailer from anoth

PostPosted: Fri Jun 14, 2013 9:43 pm
by skolusu
hsinaz wrote:I would like to do this completely in DFSORT but if it is complicated and solution is simpler in ICETOOL then I will use that. Please show me a quick example if possible.


hsinaz,

What makes you think ICETOOL solution is simpler than using DFSORT? If you are not aware ICETOOL indeed invokes DFSORT. So please get your facts straight.

Re: Header date from a file and main data/trailer from anoth

PostPosted: Fri Jun 14, 2013 10:06 pm
by hsinaz
BillyBoyo.. Thanks. I will take a look at this today.

Skolusu, clearly I have lot to learn. I am aware that ICETOOL wraps DFSort, but I was under the impression ICETOOL was able to take in multiple files, apply different control card to each and output result into a single file, kind of what I need. I.e. take in the date file, pick out the date I want and create a header record from it in memory, take in main data file, do the sort sum and then output a single file with the header, main sort sum records and a trailer. But the solution provided by BillyBoyo mostly will work for me.

Re: Header date from a file and main data/trailer from anoth

PostPosted: Fri Jun 14, 2013 10:37 pm
by BillyBoyo
If you look, the solution I linked to is Kolusu's :-)

If you start out by thinking that something must have a complicated solution, and that ICETOOL does complicated things, then you will probably end up with something unnecessarily complicated.

The more time you spend thinking about something, the simpler the solution you will come to.

Think of the data, think of the task, think about how you would do it if all you had were pencil and paper. When you become more experienced at it, you'll not need the pencil and paper except for the very complicated things.

Once you know how to do it, how to manipulate the data to get the result you want, then you can start looking at how to do that with a utility/programming language.

If you start the other way round, "complicated things" will indeed turn into "complicated" solutions.