IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Error when trying to get a sum summary of a field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chan2004

New User


Joined: 28 Mar 2007
Posts: 16
Location: India

PostPosted: Thu Apr 05, 2007 2:39 pm
Reply with quote

Hi,

I have a jcl like this:
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=t*****.SAMPLE.INPUT,DISP=SHR
//SORTOUT DD DSN=t*****.SAMPLE.OUTPUT,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(1,16,SS,EQ,C'chan') --stmnt 1
SORT FIELDS=COPY -- stmnt 2
SUM FIELDS=(1,3,BI) --stmnt 3
/*

stmnt 1 and stmnt 2 will retrieve two records like this:
100001CHAN
100002CHAN

I want to add the first 6 characters of the two records and display
But its displaying
ICE109A E SUM FIELD DISPLACEMENT OR LENGTH VALUE ERROR
SORT FIELDS=COPY
How to resolve it?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Apr 05, 2007 4:01 pm
Reply with quote

Hi There,


Quote:
I want to add the first 6 characters of the two records


Then why u gave

Code:
SUM FIELDS=(1,3,BI)
Back to top
View user's profile Send private message
chan2004

New User


Joined: 28 Mar 2007
Posts: 16
Location: India

PostPosted: Thu Apr 05, 2007 4:19 pm
Reply with quote

so that i can add 100 of first record and 100 of second record
isn't this correct
or am i missing something?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Apr 05, 2007 8:50 pm
Reply with quote

You're doing a couple of things wrong:

1) You can't use SUM with COPY. SUM adds values for duplicate keys. COPY doesn't use a key. You need SORT or MERGE with SUM.

2) The fields you want to SUM are ZD values, not BI values. (You can only SUM 2, 4 or 8 byte BI values, but since your values are actually ZD the length can be 1 to 31.)

If you're just trying to get an overall total for the value in positions 1-3, you can use this instead of SUM:

Code:

   OUTFIL REMOVECC,NODETAIL,             
      TRAILER1=(TOT=(1,3,ZD,EDIT=(TTT))) 


If you want to do something else, explain in detail what you want to do with an example of input and output.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top