IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to give input to file having record length 120


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Fri Aug 03, 2007 7:37 pm
Reply with quote

Hi all,

I was unable to give input to a file having record length of 120,
when i am trying to open it using 3.4 option in ispf it is showing like

'Invalid record length'

can anybody give solution to this.

i have tried using COBOL program also while opening itself file status of 90 is coming and i was unable to write into it.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 8:02 pm
Reply with quote

Hello,

In 3.4, enter I (for data set information) and post what you see in the General Data section of the screen.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Fri Aug 03, 2007 8:15 pm
Reply with quote

hi scherrer,

below i am giving you the dataset infirmation:
Code:

                                                                       
General Data                          Current Allocation               
Management class . . : MCTEST         Allocated cylinders : 1         
Storage class  . . . : SCTEST         Allocated extents . : 1         
Volume serial . . . : E20105                                         
Device type . . . . : 3390                                           
Data class . . . . . : **None**       Current Utilization             
Organization  . . . : PS             Used cylinders  . . : 1         
Record format . . . : FB             Used extents  . . . : 1         
Record length . . . : 120                                           
Block size  . . . . : 1200                                         
1st extent cylinders: 1                                           
Secondary cylinders : 25                                           
Data set name type  :                SMS Compressible  :   NO       
                                                                   
Creation date . . . : 2007/08/03     Referenced date . . : 2007/08/03
  Expiration date . . : ***None***                                     
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 03, 2007 8:41 pm
Reply with quote

Is it an empty file?
How is the file defined in the Input-Output Section.
What command in your program did you use to OPEN the file?
What type/version of COBOL are you using?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 8:47 pm
Reply with quote

Hello,

It sounds ike you have a cataloged dataset that has only been allocated (i.e. with IEFBR14) and not opened as output. The left-over data at that location on the dasd does not match the attributes defined for the file, so you get the error.

Do you know if the dataset was SMS-created? My guess is that it was not.

Delete the dataset, and re-create it by opening it as output either in a program or with some utility. You shold then not see this error.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Fri Aug 03, 2007 8:59 pm
Reply with quote

hi,

i have created that dataset with the following jcl,
Code:

//step1   exec   pgm=iefbr14
//dd1     dd      dsn=test.bala.infile1,disp=new,catlg,delete),
//                dcb=(lrecl=120,recfm=f,blksize=1200,dsorg=ps),
//               unit=sysda,space=(cyl,(10,15))
//


the dataset is created successfully, but the problem is when i am trying to edit in 3.4 option to give input, it is saying 'invalid record length'
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 03, 2007 9:03 pm
Reply with quote

since you are using 3.4 to edit the file. delete it, and reallocate the file in 3.2, then go to 3.4 and see if it works.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 03, 2007 9:06 pm
Reply with quote

use tracks instead of cylinders. 15, trks with 30 for extent will give you 33 cyl total before you e27.

Cylinders is a large allocation and eats up dasd. use tracks, 1 less problem for your sys-prog's/data management people to bug you about.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 9:10 pm
Reply with quote

Hello,

Yes
Quote:
i have created that dataset with the following jcl,
that is your problem. You allocated the space, but put no data in the file. If you use 3.2 online or use IEBGENER or SORT in batch to create an EOF, you should not have the problem.
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Fri Aug 03, 2007 9:10 pm
Reply with quote

I tried your JCL and ran a JCL check on it and got the following message:

Code:

//DD1     DD   DSN=MV603.BALA.INFILE1,DISP=(NEW,CATLG,DELETE),
//             DCB=(LRECL=120,RECFM=F,BLKSIZE=1200,DSORG=PS),
//             UNIT=SYSDA,SPACE=(CYL,(10,15))                 
 CAY6086E BLKSIZE INCONSISTENT WITH LRECL FOR DATA SET WITH FIXED RECORDS                                                   


And when I executed it, I got a 00 return code, but alas! cannot open the dataset because of an invalid record length!

Now if I change the RECFM to FB (fixed block), the error is solved.

Aother option is to change your BLKSIZE to 0 (allowing the system to establish the block size). Again, the error is solved.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Fri Aug 03, 2007 9:12 pm
Reply with quote

Good catch icon_smile.gif
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 177
Location: Seattle, WA

PostPosted: Fri Aug 03, 2007 9:58 pm
Reply with quote

It took a little more research, but I finally came to the root of the problem.

Let's look at your DCB (the source of the problem).

DSORG=PS - defines the dataset as physical sequential - no problem here.

RECFM=F - this says that your file's records are fixed length unblocked!!!!! - setting this to F confuses the BLKSIZE parameter and ANY value in BLKSIZE other than zero results in a corrupted dataset that cannot be used!

To correctly use the BLKSIZE parameter, the RECFM has to be FB, VB or VBS.

I knew there had to be a better explanation than what I previously offered!
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Mon Aug 06, 2007 12:05 pm
Reply with quote

Hi all,

I am very thankful to you all for your valuable suggestions,

the error is with the record format only as you all suggested, I have changed it and ran the jcl now, I am able to give input now icon_biggrin.gif .
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Aug 06, 2007 6:12 pm
Reply with quote

You're welcome.

Thank you for posting that your process now works icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top