Using INREC BUILD and overlay



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

Using INREC BUILD and overlay

Postby shilpakhaire » Fri Oct 31, 2008 9:57 pm

I have a file with an alphanumeric field. I want the sum of this field. I am using this..but gives me error....Plz correct me...

//STEP001  EXEC PGM=ICEMAN                                           
//*                                                                 
//SYSPRINT  DD SYSOUT=*                                             
//SYSOUT    DD SYSOUT=*                                             
//SYSDBOUT  DD SYSOUT=I                                             
//SYSUDUMP  DD SYSOUT=I                                             
//*                                                                 
//SORTIN   DD DSN=DW3T.NDM.SL60.FIDELITY.MSTR.ODS.NBR096,DISP=SHR   
//SORTOUT  DD DSN=DW3T.NDM.SL60.FIDELITY.MSTR.ODS.NBR096.SM,DISP=SHR
//SYSIN    DD *                                                     
  OPTION ZDPRINT                                                     
  SORT FIELDS=(1,13,CH,A)                                             
  INREC BUILD=(1,12,SFF,TO=ZD,LENGTH=12)                             
  SUM FIELDS=(75,12,ZD)                                               
  OUTREC OVERLAY=(1:1,12,ZD,M12,LENGTH=12)                           
/*                                                                   


Thanks,
Shilpa
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Very urgent - Using INREC BUILD and overlay

Postby Frank Yaeger » Fri Oct 31, 2008 10:34 pm

If it's so urgent, you should have supplied sufficient information on what you're trying to do so I could show you how to do it. But you didn't, so all I can do is tell you what you did wrong.

Here's what you're doing and the problems I see:
- INREC reformats an SFF field to a ZD field in positions 1-12. The reformatted record is 12 bytes long.
- SORT tries to sort on 1,13,ZD - but the reformatted record is only 12 bytes long so you can't sort on 13 bytes. I don't know what you're trying to SORT on, but whatever it is, INREC is changing it before you sort on it.
- SUM tries to sum on 75,12,ZD - but the reformatted record is only 12 bytes long so you can't sort on position 75. You probably want to SUM on 1,12,ZD.

If you want further help on this, you need to show me an example of your input records and what you expect for output, and explain what you're trying to do. 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: Very urgent - Using INREC BUILD and overlay

Postby shilpakhaire » Fri Oct 31, 2008 10:38 pm

Sorry..I have an inpiut file of 3229 length. I want to sum an alphanumeric field in this file which is at position 75 and has length 12.
I dont wnat to sort anything so i guess sort fields=copy should work.
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Very urgent - Using INREC BUILD and overlay

Postby Frank Yaeger » Fri Oct 31, 2008 11:08 pm

Do you want the summed field to start at position 75, or at position 1? I asked you to show me an example of your input records and what you expect for output for a reason. Please do so.
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: Very urgent - Using INREC BUILD and overlay

Postby shilpakhaire » Fri Oct 31, 2008 11:42 pm

Input file is as i described earlier. I just want a summation of the input filed at 75'th position which is 12 bytes long.
Output can be another file with just one record 12 bytes long. But his input field has decimals too. I cud xtract the field to another file, but the decimals are not coming.
e.e
8093.12
is getting xtracted as 809312 .

I want it as 8093.12 only.
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Very urgent - Using INREC BUILD and overlay

Postby Frank Yaeger » Sat Nov 01, 2008 1:03 am

Sounds like you just want a total of the 75,12,SFF field in one record in the output. If so, you can use this DFSORT job. Note that you CANNOT use the same data set for input and output.

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN   DD DSN=...  input file
//SORTOUT  DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(TOT=(75,12,SFF,EDIT=(IIIIIIIIT.TT)))
/*


For example, if the field at 75,12 contained these values:

     8093.12
     5023.13
      -23.52


SORTOUT would contain one record with this value:

    13092.73   


I don't know why you couldn't show me an example like that.
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: Very urgent - Using INREC BUILD and overlay

Postby shilpakhaire » Sat Nov 01, 2008 10:05 am

Thanks a lot Frank! You are a genius!
Saved me the tedious task of writing a program!
shilpakhaire
 
Posts: 17
Joined: Fri Oct 31, 2008 9:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Very urgent - Using INREC BUILD and overlay

Postby Frank Yaeger » Sat Nov 01, 2008 9:38 pm

You're welcome.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/supp ... tmpub.html

It will save you writing lots of programs. ;)
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


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post