Page 1 of 1

Include only empty record

PostPosted: Wed Jul 11, 2012 4:08 pm
by xcspg3
Hi,
I've got this problem with INCLUDE COND: how to include all the empty records for SORTIN with LRECL=400.
I usually use the statement INCLUDE COND=(1,1,CH,EQ,C' ') but in this case I've 400 spaces and not only 1 space.

Thanks

Max

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 4:15 pm
by BillyBoyo
If you consult the manual you'll see that you can do a "repeat" value in front of the literal. 250C' ' should give 250 spaces, for instance. You can also find out whether you can use X in the comparison. 250X is 250 spaces.

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 4:27 pm
by xcspg3
I have tried but this is wrong: COMPARISON FIELD ERROR

max

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 4:31 pm
by BillyBoyo
Which of the two did you try? Did you look in the manual? Have you looked up the error given? Did you not consult the manual but try beyond some limit that you would have found in the manual, say 256?

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 4:36 pm
by xcspg3
COMPARISON FIELD ERROR : INCLUDE COND=(1,2,CH,EQ,2C' ')
No errors : INCLUDE COND=(1,2,CH,EQ,C' ')

I think that I can't use nC' ' in include cond, in DFSORT guide I have not found info about this syntax.

max.

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 4:53 pm
by BillyBoyo
I'm not thinking. Can you try (1,2,CH,EQ,C' ') and (1,256,CH,EQ,C' ')?

EDIT: Fell in my own "trap". Now changed 400 to 256.

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 4:56 pm
by xcspg3
Yes, no results.
max

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 5:12 pm
by BillyBoyo
Mmmm.... yes, the 1,2 is truncated to the length of the literal...

You are able to code a literal up to 256 characters... I'll have to think.

If nothing else, Kolusu will rescue us later :-) Around 5pm or later UK time.

Re: Include only empty record

PostPosted: Wed Jul 11, 2012 9:30 pm
by skolusu
xcspg3,

You don't have to code 400 spaces. You can check with a single space. But the limit is 256 bytes , so you need to split the 400 bytes into chunks of 256 bytes and check. Use the following control cards

//SYSIN    DD *                                         
  INCLUDE COND=(1,256,CH,EQ,C' ',AND,257,144,CH,EQ,C' ')
  SORT FIELDS=COPY                                     
//*

Re: Include only empty record

PostPosted: Thu Jul 12, 2012 12:38 pm
by xcspg3
Thanks a lot.

Max