Page 1 of 1

Geting error as FIXED RECORD LENGTH IS NOT EQUAL TO LRECL

PostPosted: Wed Sep 23, 2015 9:24 pm
by Surabhi
Hello,

I have a file which contains input as follows:-

#abc#1504#ca56AE56#END#
#xyz#1504#ca564#END#
#abc#1504#ca123#END#
#abc#1504#ca22AE22#END#
#abc#1504#ca248#END#
#xyz#1504#ca56ca56#END#
#abc#1504#caRJAERJ#END#
#abc#1504#ca23AE23#END#

And the required output is---
#abc#1504#ca123#END#
#abc#1504#ca248#END#

This is my job------
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= input file
// DISP=OLD
//SORTOF01 DD DSN= output file
// DISP=OLD
//SYSIN DD *
OPTION COPY
OUTFIL FILES=01,INCLUDE=((2,3,CH,EQ,C'abc'),AND,(13,3,FS,EQ,NUM)),
PARSE=(%=(ENDBEFR=C'#'),
%=(ENDBEFR=C'#'),
%00=(STARTAFT=C'#',
ENDBEFR=C'#',
FIXLEN=06)),
BUILD=(%00)

/*

And i am geting the below error for that----
6 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR SORTOF01

Please help me out with this.

Re: Geting error as FIXED RECORD LENGTH IS NOT EQUAL TO LRE

PostPosted: Wed Sep 23, 2015 10:16 pm
by BillyBoyo
If you want 80-byte records, you have to ensure the BUILD is of 80 bytes.

Easiest way to do this is BUILD=(%00,80X)

That will put a blank in column 80, and pad, with blanks, the intervening data.

Re: Geting error as FIXED RECORD LENGTH IS NOT EQUAL TO LRE

PostPosted: Thu Sep 24, 2015 4:51 pm
by Surabhi
Thanks alot it did work with BUILD=(%00,76X)

Re: Geting error as FIXED RECORD LENGTH IS NOT EQUAL TO LRE

PostPosted: Thu Sep 24, 2015 4:58 pm
by Surabhi
i did get the required output as ---
ca123
ca248

but i now i want it as,
present** ca123
present** ca248

how do i add present** before??

Re: Geting error as FIXED RECORD LENGTH IS NOT EQUAL TO LRE

PostPosted: Thu Sep 24, 2015 6:55 pm
by BillyBoyo
 BUILD=(%00,76X)


That puts a named-PARSEd field, which has a FIXLEN (presumably of four) and places 76 blanks.

 BUILD=(%00,80:X)


The puts a named-PARSEd field, which as a FIXLEN, which we don't have to worry about, puts a blank in the 80th position, and fills all intervening positions between the PARSEd field and column 80 with blanks.

The latter is more maintainable. Which we see now:

 BUILD=(C'present**',%00,80:X)


Nothing to do except add the literal.

With the code you have used, you have to count the new characters and adjust the 76. And then change it again when you need the blank before the PARSEd field.

Re: Geting error as FIXED RECORD LENGTH IS NOT EQUAL TO LRE

PostPosted: Thu Sep 24, 2015 8:36 pm
by Surabhi
Thanks alot it works :)