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



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

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

Postby hsinaz » Fri Jun 14, 2013 4:58 am

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.
hsinaz
 
Posts: 4
Joined: Fri Jun 14, 2013 4:43 am
Has thanked: 0 time
Been thanked: 0 time

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

 

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

Postby BillyBoyo » Fri Jun 14, 2013 12:30 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

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

Postby skolusu » Fri Jun 14, 2013 9:43 pm

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.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

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

Postby hsinaz » Fri Jun 14, 2013 10:06 pm

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.
hsinaz
 
Posts: 4
Joined: Fri Jun 14, 2013 4:43 am
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Fri Jun 14, 2013 10:37 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post