IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Duplicate PARM on OUTFIL


 
IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sancraig16

New User


Joined: 27 Mar 2018
Posts: 26
Location: usa

PostPosted: Thu Apr 05, 2018 10:25 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Apr 05, 2018 10:36 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 877
Location: Maryland

PostPosted: Thu Apr 05, 2018 10:44 pm
Reply with quote

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
View user's profile Send private message
sancraig16

New User


Joined: 27 Mar 2018
Posts: 26
Location: usa

PostPosted: Thu Apr 05, 2018 10:50 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Apr 05, 2018 10:51 pm
Reply with quote

You can try adding the second WHEN=GROUP to your existing INREC.
Back to top
View user's profile Send private message
sancraig16

New User


Joined: 27 Mar 2018
Posts: 26
Location: usa

PostPosted: Thu Apr 05, 2018 10:53 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Apr 05, 2018 10:58 pm
Reply with quote

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
View user's profile Send private message
sancraig16

New User


Joined: 27 Mar 2018
Posts: 26
Location: usa

PostPosted: Thu Apr 05, 2018 11:02 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Apr 05, 2018 11:03 pm
Reply with quote

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
View user's profile Send private message
sancraig16

New User


Joined: 27 Mar 2018
Posts: 26
Location: usa

PostPosted: Fri Apr 06, 2018 1:58 am
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 877
Location: Maryland

PostPosted: Fri Apr 06, 2018 2:30 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Apr 06, 2018 6:05 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> SYNCSORT
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Need to read duplicate rows from tabl... DB2 3
No new posts New Parameter should be added to the ... CLIST & REXX 30
No new posts How to append data from PARM in OUTFIL DFSORT/ICETOOL 17
No new posts Compare duplicate records in same file DFSORT/ICETOOL 3
No new posts How to count duplicate key records co... SYNCSORT 0

Back to Top