Trailer style output from icetool occur



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

Trailer style output from icetool occur

Postby receive » Mon May 12, 2008 7:28 pm

I have a file about 2000 records, with either a "B", "M", "U", or blank space at position 69, and i'm trying to generate a trailer based on that.

It didn't take me very long to come up with:

OCCUR FROM(CACSIN) LIST(RPT) -                                                 
 HEADER('TYPE') ON(69,1,CH) -                                                 
 HEADER('NUMBER') ON(VALCNT,E'999999') -                                       
 BLANK 


which gives output of:
TYPE   NUMBER                                                                   
----   ------                                                                   
       000012                                                                   
B      000061                                                                   
M      000937                                                                   
U      000870


however, i'm looking to get all the data onto one line like:

XYZM000937U000870B000061


I've spent the last few hours going through my manuals and examples, and I haven't seen anything that helped as to how i should approach this, so any help would be appreciated.
receive
 
Posts: 4
Joined: Mon May 12, 2008 7:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Trailer style output from icetool occur

Postby Frank Yaeger » Mon May 12, 2008 8:42 pm

It's not clear what you're trying to do. Do you just want the trailer records or do you want the data records and the trailer records? Where does 'XYZ' come from in the trailer. Why isn't '000012' in the trailer? Why is the order M, U, B in the trailer? And so on.

Please show an example of your input records (relevant fields only) and what you expect for output. Please explain the "rules" for getting from input to output using your example. Please explain the rules for constructing the trailer. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Trailer style output from icetool occur

Postby receive » Tue May 13, 2008 2:06 pm

Frank Yaeger wrote:It's not clear what you're trying to do. Do you just want the trailer records or do you want the data records and the trailer records? Where does 'XYZ' come from in the trailer. Why isn't '000012' in the trailer? Why is the order M, U, B in the trailer? And so on.


To put my question in a bit more context, I've been asked to figure out how several jobs that run where I work currently could be achieved using icetool. In this case, i'm interested in trying to get my result into the one line trailer format that is currently produced. Ideally I'd like the data and the trailer in the same file at the end.

So, I want to be able to order M, B and U in the order they're currently ordered in and disgard the 000012. The XYZ is just static data, presumably used by whatever processes this trailer.

Frank Yaeger wrote: Please show an example of your input records (relevant fields only) and what you expect for output. Please explain the "rules" for getting from input to output using your example. Please explain the rules for constructing the trailer. Give the RECFM and LRECL of the input file. Give the starting position, length and format of all relevant fields.


The rule for output is fairly simple: Three fixed characters, M, number of occurances of M in column 69, U, number of occurances of U in column 69, B, number of occurances of B in column 69. This column 69 on the input is a character field.

The RECFM is FB, and the LRECL is 6561
receive
 
Posts: 4
Joined: Mon May 12, 2008 7:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Trailer style output from icetool occur

Postby Frank Yaeger » Tue May 13, 2008 9:30 pm

If I understand what you want (and I'm not sure I do), this DFSORT job will do it. SORTOUT will contain your trailer record with the counts.

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/6561)
//SORTOUT DD DSN=...  output file (FB/24)
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(69,1,CH,EQ,C' ')
  INREC IFTHEN=(WHEN=INIT,BUILD=(1:69,1,2:6C'0',8:6C'0',14:6C'0')),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'M'),OVERLAY=(7:C'1')),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'U'),OVERLAY=(13:C'1')),
    IFTHEN=(WHEN=(1,1,CH,EQ,C'B'),OVERLAY=(19:C'1'))
  OUTFIL REMOVECC,NODETAIL,
    BUILD=(24X),
    TRAILER1=(C'XYZM',TOT=(2,6,ZD,EDIT=(TTTTTT)),
              C'U',TOT=(8,6,ZD,EDIT=(TTTTTT)),
              C'B',TOT=(14,6,ZD,EDIT=(TTTTTT)))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Trailer style output from icetool occur

Postby receive » Wed May 14, 2008 2:19 pm

Thanks Frank, that's exactly what i was looking for.

One more question, is there a way to output the original file together with this trailer record, without reading the input file twice?
receive
 
Posts: 4
Joined: Mon May 12, 2008 7:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Trailer style output from icetool occur

Postby Frank Yaeger » Wed May 14, 2008 8:45 pm

is there a way to output the original file together with this trailer record, without reading the input file twice?


Yes, with a DFSORT job like this:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/6561)
//SORTOUT DD DSN=...  output file (FB/6561)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
      OVERLAY=(6562:6C'0',6568:6C'0',6574:6C'0')),
    IFTHEN=(WHEN=(69,1,CH,EQ,C'M'),OVERLAY=(6567:C'1')),
    IFTHEN=(WHEN=(69,1,CH,EQ,C'U'),OVERLAY=(6573:C'1')),
    IFTHEN=(WHEN=(69,1,CH,EQ,C'B'),OVERLAY=(6579:C'1'))
  OUTFIL REMOVECC,BUILD=(1,6561),
    TRAILER1=(C'XYZM',TOT=(6562,6,ZD,EDIT=(TTTTTT)),
              C'U',TOT=(6568,6,ZD,EDIT=(TTTTTT)),
              C'B',TOT=(6574,6,ZD,EDIT=(TTTTTT)))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Trailer style output from icetool occur

Postby receive » Wed May 14, 2008 9:01 pm

Frank,

That's worked perfectly. Thanks for your help :)
receive
 
Posts: 4
Joined: Mon May 12, 2008 7:10 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post