MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Browsing the dataset throwing error "Invalid block size
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Wed Jun 27, 2007 8:31 am    Post subject: Browsing the dataset throwing error "Invalid block size Reply with quote

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
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jun 27, 2007 8:38 am    Post subject: Re: Browsing the dataset throwing error "Invalid block Reply with quote

mrinalsolanki wrote:
What did I do wrong??


Nothing. It would appear that you never opened and closed the dataset.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Wed Jun 27, 2007 8:41 am    Post subject: Reply with quote

mrinalsolanki,

Trying adding the BLKSIZE parm also

Code:

LRECL=32756,BLKSIZE=32756


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
AshuSharma
Beginner


Joined: 11 Oct 2006
Posts: 6
Topics: 1

PostPosted: Wed Jun 27, 2007 9:53 am    Post subject: Reply with quote

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
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed Jun 27, 2007 10:43 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Jun 27, 2007 1:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
AshuSharma
Beginner


Joined: 11 Oct 2006
Posts: 6
Topics: 1

PostPosted: Thu Jun 28, 2007 9:51 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12377
Topics: 75
Location: San Jose

PostPosted: Thu Jun 28, 2007 9:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 28, 2007 10:48 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 28, 2007 10:51 am    Post subject: Reply with quote

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
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Jun 28, 2007 11:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Jun 28, 2007 12:51 pm    Post subject: Reply with quote

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! Razz
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Jun 28, 2007 3:08 pm    Post subject: Reply with quote

Equal to an error of course Rolling Eyes
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 28, 2007 4:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
AshuSharma
Beginner


Joined: 11 Oct 2006
Posts: 6
Topics: 1

PostPosted: Mon Jul 02, 2007 11:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group