Exclude and Edit data



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Exclude and Edit data

Postby ajay0105 » Fri Sep 24, 2010 9:34 pm

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.
ajay0105
 
Posts: 3
Joined: Fri Sep 24, 2010 9:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Exclude and Edit data

Postby NicC » Sat Sep 25, 2010 12:46 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Exclude and Edit data

Postby Frank Yaeger » Sat Sep 25, 2010 12:59 am

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
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: Exclude and Edit data

Postby ajay0105 » Tue Sep 28, 2010 10:04 am

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..
ajay0105
 
Posts: 3
Joined: Fri Sep 24, 2010 9:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Exclude and Edit data

Postby Frank Yaeger » Wed Sep 29, 2010 2:14 am

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
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


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post