|
View previous topic :: View next topic
|
| Author |
Message |
Amb
New User

Joined: 12 Mar 2010 Posts: 64 Location: India
|
|
|
|
HI,
I am trying to execute the below sort card but getting duplicate OUTREC error. Can anyone help me with this?
| Code: |
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(((24,4,CH,EQ,C'1240'),AND,((34,3,CH,EQ,C'ATM'),OR,
(34,3,CH,EQ,C'POS'),OR,(34,4,CH,EQ,C'CASH'),OR,
(34,10,CH,EQ,C'REWARDS RT'),AND,
(34,8,CH,NE,C'PROMO PT'))),
OR,(24,4,CH,EQ,C'1442'))
OUTREC IFTHEN=(WHEN=(1053,30,CH,EQ,1173,30,CH),
BUILD=(1:1,2,3:3,10,13:804,2,15:1143,30,45:2007,40,
85:C'LOCAL ',92:34,15,107:904,60,167:970,30,
197:1125,3,200:1958,38,238:401,4,242:284,9,
251:2047,8,259:C'000000001',83X)),
IFTHEN=(WHEN=(1053,30,CH,NE,1173,30,CH),
BUILD=(1:1,2,3:3,10,13:804,2,15:1143,30,45:2007,40,
85:C'FOREIGN',92:34,15,107:904,60,167:970,30,
197:1125,3,200:1958,38,238:401,4,242:284,9,
251:2047,8,259:C'000000001',83X)),
OUTFIL FILES=02,
INCLUDE=(((((24,4,CH,EQ,C'1240'),AND,((34,3,CH,EQ,C'ATM'),OR,
(34,3,CH,EQ,C'POS'),OR,(34,4,CH,EQ,C'CASH'),OR,
(34,10,CH,EQ,C'REWARDS RT'))),AND,
(34,8,CH,NE,C'PROMO PT')),
OR,(24,4,CH,EQ,C'1442')),AND,(196,7,CH,EQ,C'FOREIGN'))
OUTREC IFTHEN=(WHEN=(1053,30,CH,NE,1173,30,CH),
BUILD=(1:1,2,3:3,10,13:802,2,15:970,30,45:1268,30,
75:C'FOREIGN',82:1143,30,112:34,15,127:2007,40,
167:904,60,227:1015,38,265:401,4,269:293,9,
278:2055,8,286:302,9,295:C'000000001',47X))
|
The above sort cards work fine when I run them separately for OUTFIL FILES=01 and OUTFIL FILES=02. |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1217 Location: Dublin, Ireland
|
|
|
|
Should there be a comma at end of the lines before the OUTREC statements? and should there be a comma at the end of the line before the OUTFIL FILES=02 line? Are the parentheses correctly matched?
Garry. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Amb,
Your syntax is a bit of a mess. You have TWO OUTREC statements so the second is a duplicate. You have a comma at the end of the first OUTREC statement so it continues into the OUTFIL FILES=02 statement. I don't know if you were trying to use IFTHEN clauses with each OUTFIL statement or actually trying to use an OUTREC statement or what, so it's difficult to tell you how to fix it.
The OUTREC statement is actually processed before the OUTFIL statement but you can only have one. You can use IFTHEN clauses with each OUTFIL statement.
Removing the extra comma, your control statements would actually be processed like this so the second OUTREC statement would be ignored as a duplicate:
| Code: |
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(1053,30,CH,EQ,1173,30,CH),
BUILD=(1:1,2,3:3,10,13:804,2,15:1143,30,45:2007,40,
85:C'LOCAL ',92:34,15,107:904,60,167:970,30,
197:1125,3,200:1958,38,238:401,4,242:284,9,
251:2047,8,259:C'000000001',83X)),
IFTHEN=(WHEN=(1053,30,CH,NE,1173,30,CH),
BUILD=(1:1,2,3:3,10,13:804,2,15:1143,30,45:2007,40,
85:C'FOREIGN',92:34,15,107:904,60,167:970,30,
197:1125,3,200:1958,38,238:401,4,242:284,9,
251:2047,8,259:C'000000001',83X))
OUTREC IFTHEN=(WHEN=(1053,30,CH,NE,1173,30,CH),
BUILD=(1:1,2,3:3,10,13:802,2,15:970,30,45:1268,30,
75:C'FOREIGN',82:1143,30,112:34,15,127:2007,40,
167:904,60,227:1015,38,265:401,4,269:293,9,
278:2055,8,286:302,9,295:C'000000001',47X))
OUTFIL FILES=01,
INCLUDE=(((24,4,CH,EQ,C'1240'),AND,((34,3,CH,EQ,C'ATM'),OR,
(34,3,CH,EQ,C'POS'),OR,(34,4,CH,EQ,C'CASH'),OR,
(34,10,CH,EQ,C'REWARDS RT'),AND,
(34,8,CH,NE,C'PROMO PT'))),
OR,(24,4,CH,EQ,C'1442'))
OUTFIL FILES=02,
INCLUDE=(((((24,4,CH,EQ,C'1240'),AND,((34,3,CH,EQ,C'ATM'),OR,
(34,3,CH,EQ,C'POS'),OR,(34,4,CH,EQ,C'CASH'),OR,
(34,10,CH,EQ,C'REWARDS RT'))),AND,
(34,8,CH,NE,C'PROMO PT')),
OR,(24,4,CH,EQ,C'1442')),AND,(196,7,CH,EQ,C'FOREIGN'))
|
You need to explain what you're trying to do before I can help you clean up your syntax. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|