Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
Hi,
You are using VB file as input, so you need to add RDW(Record Descriptor Word : Data preceding a variable record that specifies the length of the entire record including the RDW.) in outputs. It takes 4-bytes.So add 4-bytes to all the contorl cards. e.g. this
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
sai mainframes,
As Anuj D. said, the first four bytes for variable file record will contains the RDW and the record contents starts from column (or position or byte) 5.
In OUTREC, RDW should be include for variable file in first four bytes i.e., OUTREC=(1,4,.....).
You are using VB file as input, so you need to add RDW(Record Descriptor Word : Data preceding a variable record that specifies the length of the entire record including the RDW.) in outputs. It takes 4-bytes.So add 4-bytes to all the contorl cards. e.g. this
Code:
//CTL2CNTL DD *
OUTREC FIELDS=(11:1,10,21:SEQNUM,8,PD)
/*
can be changed to
Code:
//CTL2CNTL DD *
OUTREC FIELDS=(15:1,10,25:SEQNUM,12,PD)
/*
Give a try.
The code you changed also doesn't include RDW in OUTREC. In the first four bytes, there is nothing in OUTREC, but suppose to be RDW there. Please correct me if I am wrong.
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
Hi Shankar,
I'd the following concept in my mind while replying..
Quote:
A record in a VB data set looks like this:
RDW Fixed data Variable data
The RDW (Record Descriptor Word) is a 4-byte binary field with the length of the record in the first two bytes. Fixed data consists of data bytes that are present in every record. Variable data consists of one or more data bytes that may or may not be present in every record, so different records can have different lengths up to the maximum logical record length (LRECL) for the data set. For VB data sets, the RDW is in positions 1-4, so the first data byte starts in position 5. So when you code your control fields for sorting or merging VB data sets, remember to add 4 to the starting position to account for the 4-byte RDW. For example, the following SORT statement specifies a CH control field in the third through fifth data bytes of a VB record:
Code:
SORT FIELDS=(7,3,CH,A)
For OUTREC...I need to check it...but it'll take time..today my Mainframe session is not working..
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
shankar,
Quote:
The code you changed also doesn't include RDW in OUTREC. In the first four bytes, there is nothing in OUTREC, but suppose to be RDW there. Please correct me if I am wrong.
One gets ‘short record’ error only when the input file has some record whose length is shorter than the positions specified the Sort Card.Something like a file containing header, trailer & the data records. Header & Trailer are usually shorter than the other data records.
You can include a OMIT condition to eliminate such records(header & trailer) and sort the others.
1,1 refers to the 1 byte data starting from position 1. You can change as per your requirements. Hope you have already changed it as you told its working.
What is the use of variable file here, as maximum record length of variable file is for all the output records?. The same mistake I did some days before and FRANK pointed out that.
When i did the run with the sai mainframes code, in my shop it's working fine. May be the default minimum record length for variable file is greater than length 32 in sai mainframes site.
The following is the message for SHORT RECORD.
Code:
WER244A [ddname] {INREC,OUTREC} SHORT RECORD
EXPLANATION: The ddname will be SORTOUT, SORTOFxx,
SORTOFx or the ddname provided by an OUTFIL FNAMES parameter.
A variable-length record was too short to contain all the fields specified
on the control statement. Program HISTOGRM may be used to determine
the length of the shortest record in the input file.
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
shankar,
Quote:
What is the use of variable file here, as maximum record length of variable file is for all the output records?. The same mistake I did some days before and FRANK pointed out that.
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
sai mainframes/Aaru,
The reason for OUTREC - SHORT RECORD is because of input records are shorter in length than the OUTREC record length specified. I did a run with some sample data for sai code which has input records are shorter in length than the OUTREC record length and i got the OUTREC -SHORT RECORD message with MAXCC=16.
Then i did a run with the same sample data I used before, which had thrown the OUTREC -SHORT RECORD and the code as Aaru suggested as follows:
This time also i got the same OUTREC -SHORT RECORD message with MAXCC=16.
I think the below code will work fine with the proper use of variable file.
Please make sure to code LRECL=16122 for TMP1, otherwise don't code the DCB parameters, it will dynamically allocate the DCB parameters as required at runtime.
First, copy the second file to TMP1 which has the longer OUTREC length than the other one. The reason is that we can't make the shorter record length larger while doing SPLICE. In the below code SPLICE will happen with the first file records.
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
Shankar,
Quote:
Then i did a run with the same sample data I used before, which had thrown the OUTREC -SHORT RECORD and the code as Aaru suggested as follows:
Code:
//CTL1CNTL DD *
OUTREC FIELDS=(1,4,5,10,25:SEQNUM,8,PD,16104:X)
/*
This time also i got the same OUTREC -SHORT RECORD message with MAXCC=16.
Your SYNCSORT Version is different from the Version which OP is using. Sai and I are using the same version and that is why it dint abend. The working JCL which i had posted worked fine for OP and will not work for you as your version is different.
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
Aaru,
Let us assume a file with RECFM=VB, LRECL=16104 and BLKSIZE=27998 contains the records as follows.
Code:
A
B
C
Please run with the below set of codes and you will find both will give the same error message OUTREC - SHORT RECORD with MAXCC=16. This is because in OUTREC we specified 5,10 and in actual file only 5,1 is available.
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
Shankar,
Quote:
Please run with the below set of codes and you will find both will give the same error message OUTREC - SHORT RECORD with MAXCC=16. This is because in OUTREC we specified 5,10 and in actual file only 5,1 is available.
I ran the job and it abended.Yes, I totally agree with this. But this is what i said too . Please check my previous post and i would have changed the condition from 5,10 as per the requirement.
For testing purpose, i created a new file with one byte data and modifed the sort card of OP ( edited 5,10 to 1,1 (it shd have been 5,1)). It worked fine and only then i posted.
OP has also tested this using the new sort card after modifying 5,10. Hope there are no confusions now.