Hi All,
I am new to COBOL and I have been struggling for a week. I have a Variable Block file and 3 copybooks (header, detail and trailer) from our Mainframe guy. The record length in Mainframe shows 27840 bytes ( I guess it means maximum length for VB format). I created 3 COBOL FD by using the copybooks.
In CFF stage, I noticed the total length of all columns is 40 bytes for header, 930 for detail and 136 for trailer. I tried to configure CFF stage in many ways and I can't read the file.
File Options: Record Type - Variable/Variable Block
Record Options: Byte Order -Native-endian; Data format- binary ; Character set: EBCDIC.
Records ID: RECORD_TYPE='H'
RECORD_TYPE_2='D'
RECORD_TYPE_3='T'
Can anyone help me with this? Thanks in advance.
Can't read Variable Block Mainframe file
Moderators: chulett, rschirm, roy
Yes, Craig. I have read the FAQ and also searched in forum about Mainframe and COBOL before I posted this. Although I learned a lot from that, i still can't figure out my problem.
In FAQ, it says mainframe variable length data has the usual attributes: a field containing the actual length of the field or record followed by the data.
But the file doesn't have such a field.
Thanks for any help
In FAQ, it says mainframe variable length data has the usual attributes: a field containing the actual length of the field or record followed by the data.
But the file doesn't have such a field.
Thanks for any help
Pradeep Kumar
Then it sounds like you may not have a "variable block" file. I'm not the best one to help for stuff like this, I've done more than my share of COBOL in the past but never actually got any hands on time with the CFF stage and not done much mainframe stuff either. You'll need to wait for other more helpful types to wander along, which may not happen over the weekend. FYI.pradkumar wrote:the file doesn't have such a field
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
It is only coincidental that I'm here to contradict Craig: I am rarely in my office on a weekend.
First, revisit the attributes of the mainframe file in detail. You need to look at two explicit data control block (DCB) attributes. LRECL is the logical record length, and BLKSIZE is the length of the block. I am guessing that 27840 is the block length, not the record length.
Unfortunately, I don't have much experience with CFF either, but the concepts are the same. When reading the mainframe file, you are depending on the DCB to manage your reads. If, for example, your copybooks indicate fixed record lengths for each record type, then you are not reading a variable length record. It could be as simple as that.
Good luck.
First, revisit the attributes of the mainframe file in detail. You need to look at two explicit data control block (DCB) attributes. LRECL is the logical record length, and BLKSIZE is the length of the block. I am guessing that 27840 is the block length, not the record length.
Unfortunately, I don't have much experience with CFF either, but the concepts are the same. When reading the mainframe file, you are depending on the DCB to manage your reads. If, for example, your copybooks indicate fixed record lengths for each record type, then you are not reading a variable length record. It could be as simple as that.
Good luck.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Merry Chrismas everyone.
I still have some problem on this one with an additional question:
I was told in Variable Block mainframe file, in the beginning of each record, there is a record prefix which indicates the actual length of the current record. So is DataStage able to read and understand the record prefix? If not, how does DataStage delimit the records in Variable Block file?
Any help would be Appreciated. Happy holidays!
I still have some problem on this one with an additional question:
I was told in Variable Block mainframe file, in the beginning of each record, there is a record prefix which indicates the actual length of the current record. So is DataStage able to read and understand the record prefix? If not, how does DataStage delimit the records in Variable Block file?
Any help would be Appreciated. Happy holidays!
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If there is a length prefix, then it will be declared in the COBOL FD and, yes, if it exists DataStage can read it. However you may have to design in the "understanding" part, perhaps by specifying {prefix} in the record schema.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Unfortunately I've not used the CFF stage much either, but like Craig have quite a bit of experience with mainframe and variable lenght files.
My only contribution to the conversation at this point is to say that the 4 bytes at the beginning of the variable length record are not always apparent when viewing the file on the mainframe so don't be sure it is not there simply because you don't see it when looking at it on the mainframe. It depends on which tool you are using to display it,
My only contribution to the conversation at this point is to say that the 4 bytes at the beginning of the variable length record are not always apparent when viewing the file on the mainframe so don't be sure it is not there simply because you don't see it when looking at it on the mainframe. It depends on which tool you are using to display it,
Bob