Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem regarding SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Problem regarding SORT
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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Feb 16, 2011 9:03 pm    Post subject:
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 Moderator


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

PostPosted: Thu Feb 17, 2011 12:43 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us