View previous topic :: View next topic
|
Author |
Message |
kanisha_prabha
New User
Joined: 10 Mar 2006 Posts: 26
|
|
|
|
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 |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
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 |
|
|
kanisha_prabha
New User
Joined: 10 Mar 2006 Posts: 26
|
|
|
|
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 |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
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 |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
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 |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
IQofaGerbil,
Do you have any idea regarding ,,viewing of all the default options ?
Thanks
Kirshy |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
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 |
|
|
kanisha_prabha
New User
Joined: 10 Mar 2006 Posts: 26
|
|
|
|
Hi,
Thank you so much. PARM=ZDPRINT did work!!
- Kanisha |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|