Page 1 of 1

vsam sort with type=f

PostPosted: Wed Sep 03, 2008 12:20 pm
by maaike c
We’re having problems with fixed/variable blocked files. After the definitions of the 2 VSAM’s you can find a sort-step as used in our JCL. Our question: What can be the impact of omitting the RECORD TYPE=F,LENGTH=(229) options in the sort-step? What is the impact on the files and on the way they are to be processed in a COBOL-program?


DEFINE CLUSTER -
(NAME(TEST.MLI.BRPTOTAL.WRITER.DATA) -
CYL(1 1) -
NONINDEXED -
SPEED ) -
DATA -
(NAME(TEST.MLI.BRPTOTAL.WRITER.DATA.DATA) -
RECORDSIZE (229 229) -
CISZ (4096))


DEFINE CLUSTER -
(NAME(TEST.MLI.BRPTOTAL.WRITER.CENTRPR) -
TRK(300 15) -
CISZ(4096) -
NONINDEXED -
RECSZ(229 229) -
FREESPACE(0 0) -
SPEED) -
DATA -
(NAME(TEST.MLI.BRPTOTAL.WRITER.CENTRPR.DATA))


//SRTTOT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=TEST.MLI.BRPTOTAL.WRITER.DATA,DISP=(SHR)
//SORTOUT DD DSN=TEST.MLI.BRPTOTAL.WRITER.CENTRPR,DISP=(SHR)
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,77,CH,A),NOEQUALS
INCLUDE COND=(34,32,CH,EQ,C'00000000000000000000000000000000')
SUM FIELDS=NONE
OPTION FILSZ=E20000
RECORD TYPE=F,LENGTH=(229)
/*

8-)

Re: vsam sort with type=f

PostPosted: Wed Sep 03, 2008 10:17 pm
by dick scherrer
Hello,

We’re having problems with fixed/variable blocked files.
What are the problems?

What can be the impact of omitting the RECORD TYPE=F,LENGTH=(229) options in the sort-step? What is the impact on the files and on the way they are to be processed in a COBOL-program?
Did you try this both ways? What happened?

Which sort product are you using? If you are not sure, look at the top of the information created by an execution of the sort. It will tell you which product and which release of that product.

Re: vsam sort with type=f

PostPosted: Thu Sep 04, 2008 1:07 pm
by maaike c
WHAT HAPPENED?
When we ran the jcl with the options specified (type,length) , we received a file-status 34 meaning:

The I/O statement failed because of a boundary violation.

This condition indicates that an attempt has been made to write beyond

the externally defined boundaries of a sequential file.


We got this message when trying to write to file TEST.MLI.BRPTOTAL.WRITER.CENTRPR. This file was opened for extend, access sequential, organization sequential.

When submitting the job without the mentioned options specified, no error occured.


WHICH SORT PRODUCT?
CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5

Re: vsam sort with type=f

PostPosted: Thu Sep 04, 2008 10:31 pm
by Frank Yaeger
What can be the impact of omitting the RECORD TYPE=F,LENGTH=(229) options in the sort-step?


When you specify

   RECORD TYPE=F,LENGTH=229


DFSORT processes the VSAM input data set as fixed length (F). DFSORT will obtain the length of 229 automatically so LENGTH=229 isn't needed.

When you don't specify the RECORD TYPE and the input and output files are VSAM, DFSORT processes the VSAM input data set as variable length (V).

Your DEFINEs appear to set up fixed-length records of 229 bytes. I duplicated your VSAM data sets and DFSORT job as closely as I could and loaded the VSAM input file with 229 byte records and it worked fine with RECORD TYPE=F. I don't know why you're getting the error you're getting with RECORD TYPE=F. Note that a VSAM file can always be processed as variable length (V) - you just have to be careful to add 4 to the starting position of each field you use. A VSAM file can be processed as fixed length (F) if the records are all the same length. Perhaps your VSAM data set was not loaded with fixed-length records correctly.

For more information on processing VSAM files with DFSORT, see:

http://publibz.boulder.ibm.com/cgi-bin/ ... 5603&CASE=