Page 1 of 1

SyncSort - Extract var length using input field value

PostPosted: Sat Nov 07, 2009 3:57 am
by Patemagnan
Hi,
I try to extract variable data from a variable length record. With an example, it is easier to explain.
The length of the data (Field 3 in the example)to be extracted is on each input record at a fix position (Field 2 in the example)
Input (variable length)
Layout:
Field 1: 8 bytes
Field 2: 2 bytes
Field 3: variable according to Field 2
Field 4: remaining of the record
Note: in the real case, there are NO delimiter between fields.
AAAAAAA-05 12345-GGGGGGGGGGGGGG
BBBBBBBB-03-123-HHHHHHHHH
CCCCCCCC-12-123456789012-IIIIIIIIIIIIIIIII
DDDDDDDD-08-12345678-KKKKKKKKKKKKKKKKKKKKKKK

Expected Output (variable length)
Field 1: 8 bytes
Field 2: 2 bytes
Field 3: variable according to Field 2

AAAAAAAA-05 12345
BBBBBBBB-03-123
CCCCCCCC-12-123456789012
DDDDDDDD-08-12345678

Is it possible to use Syncsort to perform this task ?
Thanks !

Pat

Re: SyncSort - Extract var length using input field value

PostPosted: Sat Nov 07, 2009 4:11 am
by dick scherrer
Hello Pat and welcome to the forum,

This may or may not be do-able with the current release of Syncsort.

Probably not what you are looking for, but it would be fairly simple using reference modification in COBOL.

Re: SyncSort - Extract var length using input field value

PostPosted: Sat Nov 07, 2009 4:40 am
by Patemagnan
Thanks!
I concluded to the same. I was hoping to be wrong.
To my knowledge, a Cobol program will be, by far, less performant than SyncSort.

Re: SyncSort - Extract var length using input field value

PostPosted: Sat Nov 07, 2009 6:40 am
by dick scherrer
Hello,

a Cobol program will be, by far, less performant than SyncSort
In this case the performance difference would be mostly due to way Syncsort does i/o. The actual data manipulation code wil be very inexpensive - after the read, only 1 bit of arithmetic and 1 move is needed. . .