Page 1 of 1

Beyond maximum record length error

PostPosted: Fri Mar 31, 2017 1:33 pm
by srrc
Dear All,

I am trying to join the data from two datasets using Join Keys and in the output dataset, I need it with Header and am using the following sort card.
----+----1----+----2----+----3----+----4----+----5----+----6----+
JOINKEYS FILES=F1,FIELDS=(1,3,A)
JOINKEYS FILES=F2,FIELDS=(1,3,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F2:57,2,F1:1,14)
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(5:'TAR BATCH REPORT',2/,
5:'AS ON ',JP0,3/,
4/,
5:'ATP/RXXMISSION DETAILS',
6/,
1:'ATPO/RXNS',11:'COUNTRY',19:'TOP_DATE ',/,
1:'---------',11:'-------',19:'----------',/)
OUTREC FIELDS=(1:1,3,
11:4,3,
19:9,10)

The output as per reformat is
10XYZ 28.03.2017
 9Y   28.03.2017
  1ZX 28.03.2017

I didnt mention the record length but am getting error as follow:
ICE027A 3 END OF          FIELD BEYOND MAXIMUM RECORD LENGTH


Thanks in advance.

Re: Beyond maximum record length error

PostPosted: Fri Mar 31, 2017 6:39 pm
by Robert Sample
What do you need help with? The error message is quite clear as to what is wrong. Have you looked at what DFSORT says is the length of your output data set? How does that compare to your SORT control statements?

Re: Beyond maximum record length error

PostPosted: Sat Apr 01, 2017 9:56 pm
by BillyBoyo
If you poke the message reference into a web search-engine, you'll get to the description of the message in the IBM Knowledgecentre.

A process of elimination will get you to this:

an OUTFIL field was defined as extending beyond the maximum OUTFIL input record length


And what that means in your case is the you've defined the HEADER1 output as being longer than the input to that OUTFIL processing.

Don't use OUTREC FIELDS, use OUTREC BUILD. Perhaps you can even do everything with OUTFIL BUILD (not OUTFIL OUTREC)?

Confused? That's why you should use BUILD. BUILD is a synonym for FIELDS on INREC and OUTREC and for OUTREC on OUTFIL. If you just use BUILD, I never have to type sentences like the previous two.

However you do it, the length of the record on OUTFIL cannot be shorter than what is created with HEADERn/TRAILERn.

Re: Beyond maximum record length error

PostPosted: Mon Apr 03, 2017 10:15 am
by srrc
Dear BillyBoyo,

I have tried OUTFIL BUILD as below

JOINKEYS FILES=F1,FIELDS=(1,3,A)
JOINKEYS FILES=F2,FIELDS=(1,3,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F2:57,2,F1:1,14)
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(5:'TAR BATCH REPORT',2/,
5:'AS ON ',JP0,3/,
4/,
5:'ATP/RXXMISSION DETAILS',
6/,
1:'ATPO/RXNS',11:'COUNTRY',19:'TOP_DATE ',/,
1:'---------',11:'-------',19:'----------',/)
OUTFIL BUILD=(3X,4:1,2,7X,
13:4,3,3X,
19:9,10)

But didnt got the desired output.. I am getting output as follow:
TAR BATCH REPORT
AS ON 28.03.2017

ATP/RXXMISSION DETAILS

ATPO/RXNS COUNTRY TOP_DATE
--------- ------- ----------
10BEL 28.03.2017
  9D  28.03.2017
  1RO 28.03.2017

I like to generate the output as below
TAR BATCH REPORT
AS ON 28.03.2017

ATP/RXXMISSION DETAILS

ATPO/RXNS COUNTRY TOP_DATE
--------- ------- ----------
   10       BEL   28.03.2017
    9       D     28.03.2017
            1RO   28.03.2017

please help me with the alignment..

Thanks in advance.

Re: Beyond maximum record length error

PostPosted: Mon Apr 03, 2017 4:57 pm
by BillyBoyo
You now have two OUTFIL statements for the same file. The second (your BUILD) is being ignored. Put a comma at the end of your first OUTFIL, remove OUTFIL from the BUILD.

You don't need all the column-numbers if you are using X to pad the fields. It's often clearer to use the X, so probably best to just remove the column-numbers form the BUILD.