Splitting records with FINDREP possible?



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

Re: Splitting records with FINDREP possible?

Postby Nuadha » Wed Nov 02, 2011 10:02 pm

BillyBoyo wrote:Forgot to add, the DFSORT people will maybe be looking this was at San Jose work hours, and if it can be done, they are the guys who can do it.

imbmainframeforum.com is for students and beginners, so forgive any assumptions we make based on that.

You might want to check on imbmainframes.com.

You are also very welcome to stick around and answer the questions of starters, if that takes your fancy.


That's the first time I noticed that tagline :oops:

I'll check that out, thanks!
Nuadha
 
Posts: 18
Joined: Tue Nov 01, 2011 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Re: Splitting records with FINDREP possible?

 

Re: Splitting records with FINDREP possible?

Postby BillyBoyo » Wed Nov 02, 2011 10:21 pm

Nuadha wrote:Sorry, I should say "less flexible" rather than clumsy :D

Each record with it's sub record is based on this template:
01  XB-SUB-RECORD.   
    05 XB-SUBRECORD-HEADER.
       07 XB-SUBRECORD-NAME         PIC  X(08).
       07 XB-SUBRECORD-VERSION      PIC  X(03).
       07 XB-SUBRECORD-DATA-LENGTH  PIC S9(04) COMP.
    05 XB-SUBRECORD-DATA            OCCURS 1 TO 700 TIMES
                                    DEPENDING ON SUBRECORD-DATA-LENGTH.


A "deblocking" system in our COBOL modules already exists that does what I'm trying to do, but there's talk of change to the record lengths, and as I'm currently developing a new utility, I was looking for a way of handling what I'm trying to do above without having to change COBOL in the future, i.e. make it less dependent on fixed lengths (of the subrecords).



01  the-mother-record.
any-id-stuff-for-the-mother-record here.
    03  FILLER.
        10  FILLER OCCURS 0 TO whatever-your-max-is TIMES
          DEPENDING ON W-DISPLACEMENT-FROM-START-OF-RECORD.
    03  MINI-RECORD.   
       05 XB-SUBRECORD-HEADER.
           07 XB-SUBRECORD-NAME         PIC  X(08).
           07 XB-SUBRECORD-VERSION      PIC  X(03).
           07 XB-SUBRECORD-DATA-LENGTH  PIC S9(04) COMP.
        05 XB-SUBRECORD-DATA            OCCURS 1 TO 700 TIMES
                                    DEPENDING ON SUBRECORD-DATA-LENGTH.


Now you only have one ODO to amend. Starting from zero (after any fixed portion of the main record) until fixed portion + variable already moved + fixed of mini + variable of mini is equal to the record length of the main record.

MOVE MINI-RECORD TO DEBLOCKED-RECORD (presumably also ODO, so set that size first).

Should always work as long as the records adhere to the definition you've already given. I'd check the subrecord-name each time and also that the version has a reasonable value and that the subrecord-data-length does not go over the end of the record, so basically checking that the file is consistent as far as you are able.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Splitting records with FINDREP possible?

Postby Nuadha » Wed Nov 02, 2011 10:22 pm

Thanks, we're creating the record like that in one system, then decoding in another (though the "decoded" output is never saved), so the COBOL portion is okay, other than being dependent on the 700 length. I was hoping with a system that could parse records by the record name, I could build this to avoid relying on the length of the sub-record.
Nuadha
 
Posts: 18
Joined: Tue Nov 01, 2011 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Splitting records with FINDREP possible?

Postby BillyBoyo » Wed Nov 02, 2011 10:42 pm

I see. But you are then reliant on the sequence of characters not being valid elsewhere in the records - ever. And you have in some way to still calculate the lengths (even if not explicit, and not in Cobol), which seems a pity if the lengths are already sitting there. With the self-validation thrown in, I'd be happy with it done that way.

As I say, maybe the DFSORT guys will come up with something that does it how you want.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Splitting records with FINDREP possible?

Postby Nuadha » Wed Nov 02, 2011 10:47 pm

I understand, and given the sequence of characters used, and the data within each sub-record, chances of it ever occurring natural in another context is very slim. If FINDREP could break the record using /, then I wouldn't be dependent on the lengths at all, but if that's not an option, I'd stick to the same solution you're suggesting, as I think it would be the best way of dealing with it otherwise.
Nuadha
 
Posts: 18
Joined: Tue Nov 01, 2011 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Splitting records with FINDREP possible?

Postby Frank Yaeger » Wed Nov 02, 2011 11:46 pm

FINDREP cannot break records using /.

You might be able to do this kind of thing with DFSORT's PARSE function, but it only allows up to 100 fields (%00-%99) and you need 300 so that won't work.
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

Re: Splitting records with FINDREP possible?

Postby Nuadha » Thu Nov 03, 2011 4:33 am

Thanks to you both for your help. I'll stick with the COBOL solution already. Might have another question on the part I need to do next, but I'll do so in a different thread if I need any advice, thanks!
Nuadha
 
Posts: 18
Joined: Tue Nov 01, 2011 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Splitting records with FINDREP possible?

Postby dick scherrer » Thu Nov 03, 2011 10:51 am

Hello,

I'll stick with the COBOL solution already. Might have another question on the part I need to do next, but I'll do so in a different thread if I need any advice
And this new COBOL question will be better served in the COBOL part of the forum ;)
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: 92 times

Re: Splitting records with FINDREP possible?

Postby Nuadha » Thu Nov 03, 2011 2:40 pm

Nah, it's not a COBOL question, next part is a SORT operation with a bit of JOINKEYS that's a whole new level above my previous experience ;)
Nuadha
 
Posts: 18
Joined: Tue Nov 01, 2011 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post