View previous topic :: View next topic
|
Author |
Message |
sancraig16
New User
Joined: 27 Mar 2018 Posts: 26 Location: usa
|
|
|
|
I tried adding a 2nd WHEN=GROUP statement and job failed with DUPLICATE PARM . Should I do the 2nd GROUP in a separate SORT ?
Code: |
SYSIN :
INREC IFTHEN=(WHEN=GROUP,BEGIN=(13,7,CH,EQ,C'XXXXXXX'),
END=(42,8,CH,EQ,C'YYYYYYYY'),
PUSH=(70:22,23))
OPTION COPY
OUTFIL INCLUDE=(42,8,CH,EQ,C'YYYYYYYY',OR,
42,7,CH,EQ,C'ZZZZZZZ'),
IFTHEN=(WHEN=GROUP,BEGIN=(47,7,CH,EQ,C'ZZZZZZZ'),
END=(42,8,CH,EQ,C'YYYYYYYY'),
PUSH=(100:47,24)),
BUILD=(1,120),CONVERT
*
WER813I INSTALLATION OPTIONS IN DDT LOAD LIBRARY WILL BE USED
WER270A OUTFIL STATEMENT : DUPLICATE PARM FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sancraig16,
Is this related to your other topic? Sample input and output records might help.
Not sure what you are trying to achieve, but did you try 'moving' your WHEN=GROUP to your existing INREC? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2025 Location: USA
|
|
|
|
sancraig16 wrote: |
I tried adding a 2nd WHEN=GROUP statement and job failed with DUPLICATE PARM |
1. There is no sign of any 2nd WHEN=GROUP parameter (not a statement) - ???
2. In the case if any IFTHEN used, no BUILD other than IFTHEN's subparameter is allowed. |
|
Back to top |
|
|
sancraig16
New User
Joined: 27 Mar 2018 Posts: 26 Location: usa
|
|
|
|
It is different task which I am working on . My goal is to get XXXXXX, YYYYYYY and ZZZZZZZ on the same line. Using WHEN=GROUP , I was able to PUSH XXXXXX on records of YYYYYYY and ZZZZZZ. I am now trying a 2nd WHEN=GROUP to get them all on the same record.
Code: |
XXXXXXX
00000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000
YYYYYYYY000000123
11111111111111111111111111111111111111111111111111111
ZZZZZZZ0000004569
22222222222222222222222222222222222222222222222222222
XXXXXXX
00000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000
YYYYYYYY000000222
11111111111111111111111111111111111111111111111111111
ZZZZZZZ0000008888
22222222222222222222222222222222222222222222222222222
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
You can try adding the second WHEN=GROUP to your existing INREC. |
|
Back to top |
|
|
sancraig16
New User
Joined: 27 Mar 2018 Posts: 26 Location: usa
|
|
|
|
sergeyken wrote: |
sancraig16 wrote: |
I tried adding a 2nd WHEN=GROUP statement and job failed with DUPLICATE PARM |
1. There is no sign of any 2nd WHEN=GROUP parameter (not a statement) - ???
2. In the case if any IFTHEN used, no BUILD other than IFTHEN's subparameter is allowed. |
Not sure if I am following you . The 2nd WHEN=GROUP is right after the OUTFIL INCLUDE .
Are you saying IFTHEN and BUILD cannot go together? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
The 2nd WHEN=GROUP is right after the OUTFIL INCLUDE .
|
Yes, I noticed that and hence asking you if you could modify like this (remove from OUTFIL and add to INREC).
Code: |
SYSIN :
INREC IFTHEN=(WHEN=GROUP,BEGIN=(13,7,CH,EQ,C'XXXXXXX'),
END=(42,8,CH,EQ,C'YYYYYYYY'),
PUSH=(70:22,23)),
IFTHEN=(WHEN=GROUP,BEGIN=(....),
END=(.....),
PUSH=(...))
OPTION COPY
....
... |
Quote: |
Are you saying IFTHEN and BUILD cannot go together? |
No, I was not saying that, IFTHEN and BUILD/OVERLAY could go together but I think not a GROUP/PUSH and BUILD/OVERLAY. I cannot test with your product right now. |
|
Back to top |
|
|
sancraig16
New User
Joined: 27 Mar 2018 Posts: 26 Location: usa
|
|
|
|
Arun Raj wrote: |
You can try adding the second WHEN=GROUP to your existing INREC. |
I should have thought about that. Thanks ! It works now. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sancraig16 wrote: |
Arun Raj wrote: |
You can try adding the second WHEN=GROUP to your existing INREC. |
I should have thought about that. Thanks ! It works now. |
No problem! Glad I could be of some help. |
|
Back to top |
|
|
sancraig16
New User
Joined: 27 Mar 2018 Posts: 26 Location: usa
|
|
|
|
I ran this SORT for large number of records and ran into an issue. In one set of records I do not have a matching BEGIN but do have the matching END . I was expecting the record to be omitted but it was included. In my case I did not have XXXXXXX but do have YYYYYYYY record . Anyway to exclude such occurrences? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2025 Location: USA
|
|
|
|
sancraig16 wrote: |
sergeyken wrote: |
2. In the case if any IFTHEN used, no BUILD other than IFTHEN's subparameter is allowed. |
Not sure if I am following you . The 2nd WHEN=GROUP is right after the OUTFIL INCLUDE .
Are you saying IFTHEN and BUILD cannot go together? |
Either BUILD alone, as parameter of OUTFIL statement, or multiple IFTHEN with optional BUILD subparametrs as parts of IFTHENs are allowed.
Either
Code: |
OUTFIL ...BUILD=(...)... |
or
Code: |
OUTFIL ...IFTHEN=(...,PUSH=(...)...),
...IFTHEN=(...,BUILD=(...)...),
...IFTHEN=(...,BUILD=(...)...), |
BUILD, and IFTHEN are incompatible at the same level of parameters. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sancraig16 wrote: |
I ran this SORT for large number of records and ran into an issue. In one set of records I do not have a matching BEGIN but do have the matching END . I was expecting the record to be omitted but it was included. In my case I did not have XXXXXXX but do have YYYYYYYY record . Anyway to exclude such occurrences? |
Can you post an example that includes that scenario and any other situation that could possibly occur, and the expected output from it?
Now looking back at your sample data, you might want to push 'X' record and the 'Y' record to your 'Z' record and then in the output include the 'Z' record alone. I just realized you are not doing it that way. Can you post the control statements used? |
|
Back to top |
|
|
|