View previous topic :: View next topic |
Author |
Message |
mrinalsolanki Beginner
Joined: 02 May 2006 Posts: 56 Topics: 16
|
Posted: Wed Jun 27, 2007 8:31 am Post subject: Browsing the dataset throwing error "Invalid block size |
|
|
Hi,
I am trying to create the following dataset in the JCL,
Code: | //AUDIT DD DISP=(,CATLG),DSN=&PROJQ..&PROJ..&SOURCE..AUDIT,
// UNIT=&UNIT,
// SPACE=(&SPACE,(&PRIMARY,&SCNDARY),RLSE),
// RECFM=FB,LRECL=32756 |
where
UNIT=DISK80,
COUNT=5,
SPACE=CYL,
PRIMARY=50,
SCNDARY=100,
Its creating the dataset with BLOCKSIZE = 0, and when I am trying to Browse the dataset, its giving error "Invalid block size".
What did I do wrong??
Please Help... |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Jun 27, 2007 8:38 am Post subject: Re: Browsing the dataset throwing error "Invalid block |
|
|
mrinalsolanki wrote: | What did I do wrong??
|
Nothing. It would appear that you never opened and closed the dataset. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Wed Jun 27, 2007 8:41 am Post subject: |
|
|
mrinalsolanki,
Trying adding the BLKSIZE parm also
Code: |
LRECL=32756,BLKSIZE=32756
|
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
AshuSharma Beginner
Joined: 11 Oct 2006 Posts: 6 Topics: 1
|
Posted: Wed Jun 27, 2007 9:53 am Post subject: |
|
|
Thanks kolusu and superk..
After adding the BLKSIZE parm, I was able to browse the AUDIT dataset, but its empty...
There is a C program that is writing to this dataset...
But in the program, it is accessing the dataset as
afopen("AUDIT", "wb", "seq", "recfm=v");
So, is it a problem that I am creating this dataset with
"RECFM=FB"
(I even tried to run the JCL again with
"RECFM=VB" keeping other parameters same (also specified BLKSIZE),
But then its giving error - "Invalid record length"..
What should I do??? |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Wed Jun 27, 2007 10:43 am Post subject: |
|
|
create the file,
add data to it using the editor and save that data
browse it to be sure that worked (it should)
run your program using the now existing data set
browse the data again.
If you can't read it, and you probably will not be able to, then it means the C program is writing the data incorrectly, Verify that the C program is not trying to write any lines longer than 32752 (which is LRECL-4)
One of the utilities, I forget which one, can print lrecls of each record if you need to find which record is bad. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Jun 27, 2007 1:53 pm Post subject: |
|
|
Just to re-emphasise: if the RECFM is VB then remember that BLKSIZE must be 4 bytes more than the LRECL. You should be able to omit the BLKSIZE but if you set it to 0 then the system will set it correctly for you (all things being equal, of course!). _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
AshuSharma Beginner
Joined: 11 Oct 2006 Posts: 6 Topics: 1
|
Posted: Thu Jun 28, 2007 9:51 am Post subject: |
|
|
Hi all,
I have tried all the solutions, including
RECFM=FB,LRECL=32756,BLKSIZE=32756
RECFM=VB,LRECL=32756,BLKSIZE=32756
RECFM=VB,LRECL=32756,BLKSIZE=0
For the first solution, I was able to browse dataset, but it was empty,
(Although the program is writing to it)...
For the last two solutions, it's now throwing error :
"Invalid record length". |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Thu Jun 28, 2007 9:56 am Post subject: |
|
|
AshuSharma,
Did you read the responses of semigeezer or nic clouston in this thread? Read them once again clearly.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 28, 2007 10:48 am Post subject: |
|
|
AshuSharma,
Quote: | afopen("AUDIT", "wb", "seq", "recfm=v"); |
I searched for afopen, did not get a hit; what level (vsn) of C are you using, what OS? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 28, 2007 10:51 am Post subject: |
|
|
why don't you remove the 'seq' from your open and use the
RECFM=VB,LRECL=32756,BLKSIZE=32760 _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Jun 28, 2007 11:14 am Post subject: |
|
|
Nic,
Quote: | but if you set it to 0 then the system will set it correctly for you |
But as we have seen above, only if the DSN is opened and closed coreectly, if not the DSN will get an actual BLKSIZE of 0, which tends to upset us storage guys a bit. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Jun 28, 2007 12:51 pm Post subject: |
|
|
Quote: | But as we have seen above, only if the DSN is opened and closed coreectly, if not the DSN will get an actual BLKSIZE of 0, which tends to upset us storage guys a bit. |
But note that I covered my derriere by saying "all things being equal" - double covered because I didn't say equal to what!  _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Jun 28, 2007 3:08 pm Post subject: |
|
|
Equal to an error of course  _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 28, 2007 4:24 pm Post subject: |
|
|
no response from OP yet, but as I was going thru the V1R8 z/OS XL C/C++ Programming guide, I came across this little tidbit:
Quote: |
Record format (RECFM): You can specify the following formats for variable-length records:
V Variable-length, unblocked
VA Variable-length, ASA print control characters, unblocked
VB Variable-length, blocked
|
and this
Quote: |
2.9.1.12 Access method selection
| The fopen() and freopen() keyword noseek requests QSAM (queued sequential
| access method) be used to process the data set. This request also
| indicates that the repositioning functions will not be used by the
| application. This access method generally provides the best performance.
| Omitting the keyword noseek selects BSAM (basic sequential access method)
| with NOTE and POINT macros requested, allowing repositioning functions to
| be used (where applicable) on the stream.
|
don't know if the second is applicable, but, I imagine the recfm=v is not helping. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
AshuSharma Beginner
Joined: 11 Oct 2006 Posts: 6 Topics: 1
|
Posted: Mon Jul 02, 2007 11:56 pm Post subject: |
|
|
Hi all,
I used
RECFM=VB,LRECL=32756,BLKSIZE=32760
and it worked...
There were two problems which I could found
1. RECFM=VB,LRECL=32756,BLKSIZE=0
does not work, the system was not automatically setting it correctly...
It was throwing error - "Invalid Record Length"...
2. The C program was not somehow reading this file correctly
After correcting the code, it was reading the file, and now I am able to browse it...
THANKS A LOT EVERYONE... |
|
Back to top |
|
 |
|
|