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
 

 

SORT: SUM not giving correct result

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kanisha_prabha

New User


Joined: 10 Mar 2006
Posts: 26

PostPosted: Mon Jun 19, 2006 11:26 am    Post subject: SORT: SUM not giving correct result
Reply with quote

Hi,
I have 2 files. First position of all records in file-1 contains '1'. First position of all records in file-2 contains '2'. Records are unique in each file. When I merge the files and do a sum on the first position (sort card follows), I expect to get '1' for all records that are only in File-1, '2' for all records that are in file-2 only and '3' for all records that are in both file-1 & file-2. Instead of a '3' I get a 'C' on the first position.

//SYSIN DD *
SORT FIELDS=(2,7,CH,A)
SUM FIELDS=(1,1,ZD)
/*

Could you tell me why I am getting a 'C' instead of a '3'?

- Kanisha.
Back to top
View user's profile Send private message

sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Mon Jun 19, 2006 1:12 pm    Post subject:
Reply with quote

Hi,
Please proivde the JCL with some test data which you are using.It will help you to get the correct and quick reply.

Thanks
Krishy
Back to top
View user's profile Send private message
kanisha_prabha

New User


Joined: 10 Mar 2006
Posts: 26

PostPosted: Mon Jun 19, 2006 3:17 pm    Post subject: Re: SORT: SUM not giving correct result
Reply with quote

Here is the JCL to merge ...
//MRGEPGM EXEC PGM=SORT
//SORTIN01 DD DSN=xxxxxxx.MYFIL.INFILE1,DISP=SHR
//SORTIN02 DD DSN=xxxxxxx.MYFIL.INFILE2,DISP=SHR
//SORTOUT DD DSN=xxxxxxx.MYFIL.OUTFILE,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(20,30),RLSE),
// DCB=(RECFM=FB,LRECL=79,BLKSIZE=7900,DSORG=PS)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(2,7,CH,A)
SUM FIELDS=(1,1,ZD)
/*

Infile1:
========
1AAPTM01
1AAPTSY1
1AAPTSY2
1AAPTSY3
1ABAPT18
1ABAPT19
1ABAPT28
1ABAPT29
1ABAPT38
1ABAPT39
1ABAPT48

Infile2:
========
2AAPTM01
2AAPTSY1
2AAPTSY2
2AAPTSY3
2ABSER17
2ABSER18
2ABSER19
2ABSER27
2ABSER28

Outfile:
========
CAAPTM01
CAAPTSY1
CAAPTSY2
CAAPTSY3
1ABAPT18
1ABAPT19
1ABAPT28
1ABAPT29
1ABAPT38
1ABAPT39
1ABAPT48
2ABSER17
2ABSER18
2ABSER19
2ABSER27
2ABSER28


Concern: the first four records in outfile has 'C' in first position. I expected a '3'.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Mon Jun 19, 2006 3:43 pm    Post subject:
Reply with quote

Hi,
I just copied your jcl and ran in my system.I am getting the o/p as you are expecting.Not sure why you are getting the diffrent o/p.

I ran the below jcl.

Code:


//MRGEPGM EXEC PGM=SORT             
//SORTIN01 DD *                     
1AAPTM01                           
1AAPTSY1                           
1AAPTSY2                           
1AAPTSY3                           
1ABAPT18                           
1ABAPT19                           
1ABAPT28                           
1ABAPT29                           
1ABAPT38                           
1ABAPT39                           
1ABAPT48                           
//SORTIN02 DD *                     
2AAPTM01                           
2AAPTSY1                           
2AAPTSY2                           
2AAPTSY3                           
2ABSER17                           
2ABSER18                           
2ABSER19                           
2ABSER27                           
2ABSER28                           
//SORTOUT  DD SYSOUT=*             
//SYSPRINT DD SYSOUT=*             
//SYSOUT   DD SYSOUT=*             
//SYSIN    DD *                     
 MERGE FIELDS=(2,7,CH,A)           
 SUM FIELDS=(1,1,ZD)               
/*                                 


My o/p is :

3AAPTM01
3AAPTSY1
3AAPTSY2
3AAPTSY3
1ABAPT18
1ABAPT19
1ABAPT28
1ABAPT29
1ABAPT38
1ABAPT39
1ABAPT48
2ABSER17
2ABSER18
2ABSER19
2ABSER27
2ABSER28

Thank you
Krishy
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Mon Jun 19, 2006 4:07 pm    Post subject: Re: SORT: SUM not giving correct result
Reply with quote

Your shop must have the ZDPRINT default option set to N

So if you code

//MRGEPGM EXEC PGM=SORT,PARM=ZDPRINT

you should get the result you want
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Mon Jun 19, 2006 4:27 pm    Post subject:
Reply with quote

IQofaGerbil,
Do you have any idea regarding ,,viewing of all the default options ?

Thanks
Kirshy
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Mon Jun 19, 2006 4:36 pm    Post subject: Re: SORT: SUM not giving correct result
Reply with quote

If you look at the SYSOUT for any of your sort jobs you will see the default values that you have set in your shop, look for OPTIONS:

eg one line from my SYOUT is
OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE
Back to top
View user's profile Send private message
kanisha_prabha

New User


Joined: 10 Mar 2006
Posts: 26

PostPosted: Mon Jun 19, 2006 4:55 pm    Post subject:
Reply with quote

Hi,
Thank you so much. PARM=ZDPRINT did work!!

- Kanisha
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: Mon Jun 19, 2006 9:06 pm    Post subject:
Reply with quote

Note that you don't have to specify the ZDPRINT option as a PARM - you can specify it in a control statement as well, e.g.

Code:

//SYSIN DD *
   OPTION ZDPRINT
   ...
/*
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 SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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