Page 1 of 2

Copy VB to FB with smaller LRECL without truncating

PostPosted: Wed Dec 12, 2012 4:20 pm
by Sephiburp
Hello there,

I'm looking a way to copy a dsn with lrecl VB 255 to a dsn with FB 133 without losing any data (no truncating).
I'd like to keep the data over 133 characters on the first line and put it at the begining of the next line, and so on.
Just like it's done with Icetool and its Resize operator (see example 3 here)

On my site, since we have Syncsort instead of Icetool, I need to find a way with Syncsort.

I guess I could try with the OUTREC control statement and some of its parameters like IFTHEN or IFOUTLEN but I'm a totally newbie and I don't know where to start...
Do you guys have some clue ?


For example, I have this kind of data in the input dsn :
LINE1111111LINE222
2222LINE3333333LIN
E4444444LINE555555
5LINE6666666


The idea is to get the following output :
LINE1111111
LINE2222222
LINE3333333
LINE4444444
LINE5555555
LINE6666666

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Wed Dec 12, 2012 5:41 pm
by BillyBoyo
Does your data actually appear on more than one record?

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Wed Dec 12, 2012 5:47 pm
by Sephiburp
Yes it does.

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Wed Dec 12, 2012 5:52 pm
by BillyBoyo
That's "handy" (can't find the Irony tags, as usual).

Is there a "pattern" to this behaviour? If your data can start in any one of 251 positions, the code will be "lengthy" in Sort.

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Thu Dec 13, 2012 1:41 am
by Sephiburp
I'm not sure to understand well your question, but I would answer : yes the data can start in any one of 251 positions.

Just go back on my previous example.

Input VB 22 :
LINE1111111LINE222
2222LINE3333333LIN
E4444444LINE555555
5LINE6666666LINE77
77777LINE8888888LI
NE9999999LINE00000
00


The input file is VB 22 (4+18), length 18 is too long for the content.
Each real line begins with "LINE" and length is 11.
Hence the need to copy to a FB 11 so that the whole file is correct.

Output FB 11
LINE1111111
LINE2222222
LINE3333333
LINE4444444
LINE5555555
LINE6666666
LINE7777777
LINE8888888
LINE9999999
LINE0000000

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Thu Dec 13, 2012 1:54 am
by Akatsukami
Whilst, if you need this yesterday, *Sort may be the way to go (if only because you can get experts such as Mr. Boyo or Mr Kolusu to write the control deck for you), you may wish to undertake an in-depth (i.e., not just learning to spell the name) study of some programming language so that in the future you may quickly and easily handle these trivial problems on your own.

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Thu Dec 13, 2012 2:50 am
by dick scherrer
Hello,

How many records might there be in the input?

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Thu Dec 13, 2012 2:55 am
by Sephiburp
The input file change every day, number of records might never be the same.

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Thu Dec 13, 2012 2:59 am
by Akatsukami
Then give us an order-of-estimate for the range.

Re: Copy VB to FB with smaller LRECL without truncating

PostPosted: Thu Dec 13, 2012 3:02 am
by Sephiburp
Could be from 100 to 5000 records.