OMIT cond on sort rule not working



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

OMIT cond on sort rule not working

Postby danilohgds » Tue Oct 18, 2011 2:46 am

Hello there everyone. First post here :D


I'm having a problem where some of my files are getting weird records added to them. I wasn't able to detect where the records came from then i decided that i should just OMIT then in the sort card. The records have a field with blank value PAPER-RAG-REC-IND.

Here it is how it's defined in the COBOL copybook.

06 W233-PAPER-RAG-REC-IND PIC X VALUE SPACES.
88 W233-RAG-HDR-REC VALUE '0'.
88 W233-NOT-RAG-HDR-REC VALUE '1'.

And here it's the field after i map the output file with the copybook on fileaid.

W233-PAPER-RAG-REC-IND
1/AN
(51-51)
10--------------------
**************** TOP OF
1
1
1


But my problem is that my second OMIT COND statement isn't working, OMIT COND=((144,1,CH,EQ,C' '),AND,(51,1,CH,EQ,C' ')) . I thought the problem could be because the file
has a variable rec len of 4, so i tried positions 55 and 47, but had no success in either one of them.

My question is how should i write the omit cond to hide every record where paper rag is blank
danilohgds
 
Posts: 2
Joined: Tue Oct 18, 2011 2:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: OMIT cond on sort rule not working

Postby enrico-sorichetti » Tue Oct 18, 2011 3:11 am

OMIT cond on sort rule not working

... it works the way You asked it

meditate a bit on the meaning of the AND and OR operators ...
and You will see that sort behaves according to Your <instructions>
the records will be omitted only if both conditions are satisfied
most probably You might want to use an OR


a mild advice when posting to a NON COBOL forum ...
refrain from using COBOL terminology just refer to the data in terms of
position, length, format
the format could be... character, packed, binary, zoned, signed zoned, leading sign, trailing sign, .....
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: OMIT cond on sort rule not working

Postby Frank Yaeger » Tue Oct 18, 2011 3:23 am

danilohgds,

I believe you want OR, not AND, and you also need to add +4 to your positions to account for the RDW:

  OMIT COND=(148,1,CH,EQ,C' ',OR,55,1,CH,EQ,C' ')
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: OMIT cond on sort rule not working

Postby danilohgds » Tue Oct 18, 2011 3:24 am

It worked with the OR. Kinda makes me feel like a fool, but i guess 10 hours straight of work are affecting me. Thanks for the help enrico. And also Frank who i talked with :D
danilohgds
 
Posts: 2
Joined: Tue Oct 18, 2011 2:37 am
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post