Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SORTOUT Error

Status
Not open for further replies.

randy700

Programmer
Sep 25, 2003
2,384
US
Can someone tell me what I have wrong here?
This code works:
Code:
//STEP02  EXEC PGM=SORT
//SORTLIB  DD  DSN=SYS1.SORTLIB,DISP=SHR
//SORTWK01 DD  UNIT=DISK6,SPACE=(CYL,(75,25),RLSE)
//SORTWK02 DD  UNIT=DISK6,SPACE=(CYL,(75,25),RLSE)
//SYSOUT   DD  SYSOUT=X
//SORTIN   DD  DSN=TST1.LVL6.INPUT.FILE.#01,DISP=SHR
//SORTOUT  DD  DSN=TST1.LVL6.OUTPUT.FILE.#02,
//             SPACE=(CYL,(1,5),RLSE),UNIT=SYSDA,
//             DCB=(RECFM=FB,LRECL=04,BLKSIZE=27996),
//             DISP=(,CATLG,DELETE)
//SYSIN    DD  *
   SORT   FIELDS=(20,2,A,18,2,A),FORMAT=BI
   OMIT     COND=(18,2,CH,EQ,C'**')
   OUTFIL FNAMES=SORTOUT,OUTREC=(1:20,2,3:18,2)
/*
//*
However, when I change the output record length to 80, I get an error:
Code:
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE222A 0 4 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR SORTOUT
All I want to accomplish is to create an 80 byte record.
What do I have wrong?

Randy
 

Found the answer.
Code:
//SYSIN    DD  *
   SORT   FIELDS=(20,2,A,18,2,A),FORMAT=BI
   OMIT     COND=(18,2,CH,EQ,C'**')
   OUTFIL FNAMES=SORTOUT,OUTREC=(1:20,2,3:18,2[COLOR=red][b],5:C76' '[/b][/color])


Randy
 
you have specified LRECL=04, i.e. the Logical Record Length is 4, which conflicts with the specified record length of 80. Change LRECL to 80. Also, the BLKSIZE must be a multiple of 80.
 


webrabbit:
Your response does not address the problem.
However, when I change the output record length to 80, I get an error:


Randy
 
First, you should NOT use SORTWK** statements unless you've been specifically directed by IBM or your technical support team to do so. Using them could restrict your ability to properly process your sort using the best resource options.

Second, you NEVER specify DCB parameters on a SORT output DD statement. SORT always uses a dynamic allocation based on the criteria you provide in your control statements. For your job, you should specify the required output LRECL of 80 bytes thus:

OUTFIL FNAMES=SORTOUT,OUTREC=(1:20,2,3:18,2,80:X)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top