Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Error when trying to get a sum summary of a field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Error when trying to get a sum summary of a field
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: 1187
Location: Bangalore,India

PostPosted: Thu Apr 05, 2007 4:01 pm    Post subject:
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    Post subject: Re: Error when trying to get a sum summary of a field
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 Moderator


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

PostPosted: Thu Apr 05, 2007 8:50 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us