Help in Sorting this



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

Help in Sorting this

Postby Melvin_vt » Sun Jul 11, 2010 4:45 am

I want to get data from a file which has a record length of VBM 8230.

 BROWSE    Input File Line 000
 Command ===>
********************************* Top of Data ****************
     1         2         3         4         
5....0....5....0....5....0....5....0....5
<RESOURCES>>XXXX   !..AAA.A.......
<RESOURCES>>XXXX   !..AAA.AAB.... .......
AAAAAAAAAAAAAFFFF
AAAAAAAAAAAAAFFFF


We can receive different combinations and the sort should be able to check the no AAAAAAAAAAAAA and the char 'FFFF'.
And also all the time we need to have the Resources. The Resources are always fixed. The AAAAAAAAAAAAA and FFFF can keep on varying.

So this what I did

SORT FIELDS=COPY
OUTFIL FNAMES=FFFF,
      INCLUDE=(((5,13,CH,EQ,C'AAAAAAAAAAAAA'),
              OR,(5,13,CH,EQ,C'TTTTTTTTTTTTT')),AND,
              ((18,4,CH,EQ,C'FFFF')),OR,
              ((18,4,CH,EQ,C'XXXX')))
/*


But with the above sort I can manage to get resources (ie <Resources>>XXXX) no AAAAAAAAAAAAAFFFF in the output file.

And when I use the sort below I get only AAAAAAAAAAAAAFFFF in the output no <RESOURCES>>XXXX.
//SYSIN    DD *
 SORT FIELDS=COPY
 OUTFIL FNAMES=FFFF,
        INCLUDE=(((5,13,CH,EQ,C'AAAAAAAAAAAAA'),
               OR,(5,13,CH,EQ,C'TTTTTTTTTTTTT'),
               OR,(7,9,CH,EQ,C'RESOURCES')),AND,
             ((18,4,CH,EQ,C'FFFF')),OR,
         ((18,4,CH,EQ,C'XXXX')))
/*


Please let me know how to get both of them in the same file.
Melvin_vt
 
Posts: 1
Joined: Sun Jul 11, 2010 3:56 am
Has thanked: 0 time
Been thanked: 0 time

Re: Help in Sorting this

 

Re: Help in Sorting this

Postby dick scherrer » Sun Jul 11, 2010 8:29 am

Hello and welcome to the forum,

Suggest you become familiar/comfortable with the "Code" tag which will preserve alignment and make the post more readable (your data and code have been "Code'd").

Also, when posting data, it is helpful (both for you and for us) to add "ruler" to show data positions.

It appears that the code expects RESOURCES in the wrong positions. It also appears that there may be problems with the parenthetical expressions - so the expected result does not happen.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Help in Sorting this

Postby Frank Yaeger » Mon Jul 12, 2010 8:34 pm

Melvin,

Note that a VBM record looks like this:

rrrrmdata...

where rrrr is the RDW in positions 1-4.
m is the machine control character in position 5.
data starts in position 6.

So you need to reevaluate your starting positions given that the data starts in position 6, not position 5.

As to what control statements you actually need, that depends on what exactly you're trying to do which you haven't explained well.
Show an example of the records in your input files and what you expect for output. Explain the "rules" for getting from input to output.
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: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post