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

Help required for writing a sort card


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

New User


Joined: 02 Dec 2003
Posts: 6

PostPosted: Tue Nov 04, 2008 2:35 pm
Reply with quote

Hi All,

I want to write a sort card to omit records matching the below criteria.

OMIT COND=(226,1,CH,EQ,C'X',AND,3,3,CH,EQ,any of the values(T08,T09,T10,T11,P0Y,P0Z,P1A,P1B))

thanks & Regards,
Sunil.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Tue Nov 04, 2008 2:51 pm
Reply with quote

Have you tried

Code:
  OMIT COND=(226,1,CH,EQ,C'X',AND,                         
            (3,3,CH,EQ,C'T08',OR,3,3,CH,EQ,C'T09',OR,       
             3,3,CH,EQ,C'T10',OR,3,3,CH,EQ,C'T11',OR,       
             3,3,CH,EQ,C'P0Y',OR,3,3,CH,EQ,C'p0z',OR,       
             3,3,CH,EQ,C'P1A',OR,3,3,CH,EQ,C'P1B'))         


Garry.
Back to top
View user's profile Send private message
sunilsangaraju

New User


Joined: 02 Dec 2003
Posts: 6

PostPosted: Tue Nov 04, 2008 3:02 pm
Reply with quote

Hi Garry,

Already tried the same code but i am getting the abend that is attached.

Sunil.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Nov 04, 2008 3:06 pm
Reply with quote

DO NOT POST SCREENSHOTS
why use 50kb when numberoflines * 80 is enough

also DSS..... are not sort messages
maybe you are using a jcl checker who believes on its smartness to check sort statements

but jcl checkers are seldom up to date with the current syntax of most sort products
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Tue Nov 04, 2008 3:21 pm
Reply with quote

Also -

Why are you using both INCLUDE and OMIT keywords in the same SORT=COPY ?? You should use either INCLUDE or OMIT.

Garry.
Back to top
View user's profile Send private message
sunilsangaraju

New User


Joined: 02 Dec 2003
Posts: 6

PostPosted: Tue Nov 04, 2008 3:33 pm
Reply with quote

Hi Garry,

My requirement is to include the records that have X in position 225 and exclude the records with (x in position 226 and T08,T09 etc in position 3).

regards,
Sunil.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Nov 04, 2008 3:38 pm
Reply with quote

Are you sure that INCLUDE and OMIT can be used in the same statement like you have shown ?
Back to top
View user's profile Send private message
sunilsangaraju

New User


Joined: 02 Dec 2003
Posts: 6

PostPosted: Tue Nov 04, 2008 4:02 pm
Reply with quote

Hi Garry,

Include and Omit does not work in the same statement.
i have split my sort card into 2, 1 for include and 2 for omit.
it is working fine for the above process.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Tue Nov 04, 2008 4:06 pm
Reply with quote

I believe you can only have either INCLUDE or OMIT. Depending on your exact requriements, you need to specify the complete condition in the one statement e.g.


Code:
  INCLUDE COND=(225,1,CH,EQ,C'X',AND,                       
                (226,1,CH,NE,C'X',AND,                     
                  (3,3,CH,EQ,C'T08',OR,3,3,CH,EQ,C'T09',OR,
                   3,3,CH,EQ,C'T10',OR,3,3,CH,EQ,C'T11',OR,
                   3,3,CH,EQ,C'P0Y',OR,3,3,CH,EQ,C'P0Z',OR,
                   3,3,CH,EQ,C'P1A',OR,3,3,CH,EQ,C'P1B'))) 




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: Tue Nov 04, 2008 9:43 pm
Reply with quote

Quote:
My requirement is to include the records that have X in position 225 and exclude the records with (x in position 226 and T08,T09 etc in position 3).


This is an ambiguous definition for your requirement. For example, would you want to include or exclude a record that has X in position 225, X in position 226 and T08 in positions 3-5? You need to define what you want more clearly.

Note that you don't need to write all those OR conditions for the 3-5 test - you can use an SS condition like this:

Code:

  3,3,SS,xx,
  C'T08,T09,T10,T11,P0Y,P0Z,P1A,P1B'


where xx is EQ or NE.
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: Tue Nov 04, 2008 9:45 pm
Reply with quote

Quote:
Include and Omit does not work in the same statement.


You cannot have an INCLUDE statement and an OMIT statement.

You can have an INCLUDE statement and an OMIT operand in an OUTFIL statement.

You can write an INCLUDE statement in such a way that it handles "include" and "omit" conditions.
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 Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top