IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem regarding SORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Amb

New User


Joined: 12 Mar 2010
Posts: 64
Location: India

PostPosted: Wed Feb 16, 2011 3:20 pm
Reply with quote

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

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Feb 16, 2011 9:03 pm
Reply with quote

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

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Feb 17, 2011 12:43 am
Reply with quote

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

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top