View previous topic :: View next topic
|
Author |
Message |
raam_kumar
New User
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
|
|
|
|
Hi
I have the following requirement
input PS file:
abcde 201 4000
abcde 201 5000
abcde 201 0500
abcde 301 0100
abcde 301 0010
xyz 201 2500
xyz 301 2000
output:
abcde 201 9500
abcde 301 0110
xyz 201 2500
xyz 301 2000
Can this be obtained using SYNCSORT. if yes could anyone give the sort card for this requirement |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. Since your records are already in order by the keys, I used a MERGE which is more efficient than a SORT.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN01 DD *
abcde 201 4000
abcde 201 5000
abcde 201 0500
abcde 301 0100
abcde 301 0010
xyz 201 2500
xyz 301 2000
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(1,9,CH,A)
OPTION ZDPRINT
SUM FIELDS=(11,4,ZD)
/*
|
|
|
Back to top |
|
|
raam_kumar
New User
Joined: 25 Apr 2007 Posts: 44 Location: chennai, India
|
|
|
|
Thanks Frank |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
One more way....
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCDE 201 4000
ABCDE 201 5000
ABCDE 201 0500
ABCDE 301 0100
ABCDE 301 0010
XYZ 201 2500
XYZ 301 2000
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=(11,4,ZD)
//* |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Raak,
You've actually shown a less efficient way to do it that doesn't produce the correct output.
Doing a SORT is less efficient then doing a MERGE. That's why I showed a job using a MERGE.
Without ZDPRINT the ZD output values will not be displayed as requested (they will have a C sign instead of an F sign) so the output will be:
Code: |
abcde 201 950{
abcde 301 011{
xyz 201 2500
xyz 301 2000
|
ZDPRINT is needed to get the correct output of:
Code: |
abcde 201 9500
abcde 301 0110
xyz 201 2500
xyz 301 2000
|
That's why I showed a job using ZDPRINT. |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Frank,
Quote: |
Doing a SORT is less efficient then doing a MERGE. |
Thanks for this piece of information...
But i have a doubt on the later point.
Quote: |
Without ZDPRINT the ZD output values will not be displayed as requested (they will have a C sign instead of an F sign) |
Because when i used the JCL that i posted above, i am getting the result as shown below.
Code: |
ABCDE 201 9500
ABCDE 301 0110
XYZ 201 2500
XYZ 301 2000 |
I didn't use ZDPRINT. When i give a Hex On, iam getting F under the last value, not C.
To add, I am using SYNCSORT, but the same option of ZDPRINT is there in Syncsort also.
Is the ZDPRINT option the default one?? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you're getting an F, not a C, then ZDPRINT is in effect at YOUR site. But that may not be the case for everyone.
I believe Syncsort does have ZDPRINT=YES as their shipped installation default.
DFSORT has ZDPRINT=YES as its shipped installation default for z/OS DFSORT V1R5, but has ZDPRINT=NO as its shipped installation default for DFSORT R14.
But the site can change the shipped installation default, so even with z/OS DFSORT V1R5 or Syncsort, the installation default can be ZDPRINT=NO.
Therefore, it's prudent to specify the ZDPRINT run-time option explicitly to make sure its in effect regardless of what the installation default is set to. |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Frank,
thanks for this piece of info..
Quote: |
Therefore, it's prudent to specify the ZDPRINT run-time option explicitly to make sure its in effect regardless of what the installation default is set to. |
I l always keep this in mind.... |
|
Back to top |
|
|
|