Page 1 of 1

Exclude and Edit data

PostPosted: Fri Sep 24, 2010 9:34 pm
by ajay0105
I have a requirement to copy a file through sort with some exclusions and editing of data contents of one field.

· I need to exclude records having a value of 88, 92,96,98 in the field starting at 268 position and 2 bytes numeric in length

· I need to exclude records having a value of 096 in the field starting at 233 and 3 bytes numeric in length

· While copying I need to edit the contents of the field starting at position 23, 5 bytes numeric from a non zero value to zero.

Re: Exclude and Edit data

PostPosted: Sat Sep 25, 2010 12:46 am
by NicC
Looks to me a fairly simple use of multiple INCLUDEs or EXCLUDEs depending on usage of NE or EQ followed by a build of the output record using bytes 1 to 22, a constant of 0 and then bytes 28 to the end.

Re: Exclude and Edit data

PostPosted: Sat Sep 25, 2010 12:59 am
by Frank Yaeger
Assuming that your numeric values are CH (e.g. '88'), you can use these DFSORT control statements:

     OPTION COPY
     OMIT COND=(268,2,SS,EQ,C'88,92,96,98',OR,233,3,CH,EQ,C'096')
     INREC OVERLAY=(23:+0,TO=ZD,LENGTH=5)


If that isn't what you want, then be more specific about what the numeric values look like (in hex).

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080

Re: Exclude and Edit data

PostPosted: Tue Sep 28, 2010 10:04 am
by ajay0105
Hi Frank,
Good Morning!!!

Thanks For your promt response

I have written a sort card for my Requirement.

1)While copying I need to edit the contents of the field starting at position 23, 5 bytes numeric from a non zero value to zero

It will be

INREC IFTHEN=(WHEN=(23,5,CH,GT,C'0')
OVERLAY=(23:C'00000')

but it is not giving me the desire result.Kindly tell where I am wrong.

Also Kindly explain me the solution
OPTION COPY
OMIT COND=(268,2,SS,EQ,C'88,92,96,98',OR,233,3,CH,EQ,C'096')
INREC OVERLAY=(23:+0,TO=ZD,LENGTH=5)
many thanks in advance..

Re: Exclude and Edit data

PostPosted: Wed Sep 29, 2010 2:14 am
by Frank Yaeger
but it is not giving me the desire result.Kindly tell where I am wrong.


How can I tell you where you are wrong when you haven't given me any useful details about how it is "not giving you the desired result"?

Show an example of the records in your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files.

Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN    DD    *
    OPTION COPY
/*


Also Kindly explain me the solution


Since you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080