View previous topic :: View next topic
|
Author |
Message |
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Hi,
I noticed this problem when i was sorting a variable length file.
My requirement is explained below.
Input file
Code: |
01 DATA-ID PIC X(19).
01 EMP-ID PIC X(5).
01 NAME
05 TITLE PIC X(30).
05 FNAME PIC X(30).
05 MIDDLE-NAME PIC X(30).
05 SUR-NAME PIC X(10). |
Output file should be of below format
Code: |
01 DATA-ID PIC S9(18) COMP.
01 EMP-ID PIC S9(5) COMP.
01 NAME
05 TITLE PIC X(30).
05 FNAME PIC X(30).
05 MIDDLE-NAME PIC X(30).
05 SUR-NAME PIC X(30). |
Both the files are of variable format with input length being
To achieve i used the below sort card
Code: |
SORT FIELDS=COPY
OUTREC FIELDS= (1,4,5:5,19,ZD,BI,13:24,5,ZD,BI,16:29,30,
46:59,30,76:89,30,106:119,10,20X) |
Scenario 1: Input file with one record having data with last field SURNAME fully filled meaning positions 115 to 124 are filled.
Result: Job ran successfully.
Scenario 2: Input file with one record having data with SURNAME field having data from position 115 to 119.
Result: Job Failed with
Code: |
WER244A OUTREC SHORT RECORD ERROR. |
Can anyone explain what happened here...? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Can anyone explain what happened here...? |
an input record was too short to contain all the fields used to build he output record ! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can anyone explain what happened here...? |
Hopefully, if you looked up that message in the appropriate message manual, it would explain what happened. That's what messages and message manuals are for! |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Thanks Frank. I looked up in the manual and got the same message and was advised to use VLFILL parameter which i did and job ran successfully.
But my question is even though in both the scenarios input files are of same format and same length, it failed in second scenario due to last field not having its every byte filled even when other fields are not completely filled(in both scenarios).
Is this SHORT RECORD error comes only when the input file's last field is not having its every bytes filled? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
Is this SHORT RECORD error comes only when the input file's last field is not having its every bytes filled?
|
No. The short record error will happen whenever the input record isn't long enough to provide a field to move to output. It doesn't matter whether the last field is not filled - the 2nd last field could be short of missing missing....
Garry. |
|
Back to top |
|
|
mushreyas
New User
Joined: 18 Jul 2008 Posts: 59 Location: Bangalore
|
|
|
|
Thanks Gary for your information. As my input file is also of Variable Length the only way to overcome this error is to use VLFILL parameter or is there any other way...? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
... is to use VLFILL parameter or is there any other way...? |
since that is the proper way, be satisfied with it
no reason for us to waste time searching for alternatives
naturally you are free to use your time for that |
|
Back to top |
|
|
|