How to skip the trailer record
Moderators: chulett, rschirm, roy
How to skip the trailer record
Hi,
How to skip the trailer record which has a different layout from the detail record. File is in ebcidic format. How can we do this with out any warning.
Regards
kumar
How to skip the trailer record which has a different layout from the detail record. File is in ebcidic format. How can we do this with out any warning.
Regards
kumar
You are already using CFF, so what did you use for file metadata?
EBCDIC files with headers/trailers typically are defined in terms of a COBOL file structure, where the header and trailer are REDEFINES of the base record structure.
I believe that the CFF will handle such correctly, as long as the schema matches the file.
Did you use a schema, or enter the metadata by hand?
Carter
EBCDIC files with headers/trailers typically are defined in terms of a COBOL file structure, where the header and trailer are REDEFINES of the base record structure.
I believe that the CFF will handle such correctly, as long as the schema matches the file.
Did you use a schema, or enter the metadata by hand?
Carter
Kumar,
Why not handle this by a before job subroutine which executes Unix cmds which strip the Header and Trailer in a shell script. Then have the CFF metadata for the Data records
HTH
dsrules
Why not handle this by a before job subroutine which executes Unix cmds which strip the Header and Trailer in a shell script. Then have the CFF metadata for the Data records
HTH
dsrules
______________________________________
"Everytime I close the door on reality, it comes in through the windows." - Jennifer Yane
"Everytime I close the door on reality, it comes in through the windows." - Jennifer Yane
Hi Carter,
The layout structure for trailier and detail is quite different. The record length also varies.
So basically i cant use trailer or header layout in the usage of detial records. Hene if detial layout reaches the trailer record it throws warning.
Hi dsrules,
Since this is an ebcidic file, we cant preprocess in unix.
regards
kumar
The layout structure for trailier and detail is quite different. The record length also varies.
So basically i cant use trailer or header layout in the usage of detial records. Hene if detial layout reaches the trailer record it throws warning.
Hi dsrules,
Since this is an ebcidic file, we cant preprocess in unix.
regards
kumar
Hi Caraig,chulett wrote:The fact that it is an EBCDIC file doesn't stop you from 'preprocessing' the file in UNIX... the 'head' or 'tail' command could care less if it's EBCDIC, ASCII or Sanskrit. Go for it.
Pls let me know the way to skip the trailer.
My point in ebcidic format is - if its in ascii i can manage to read the header and use head command till n-1. But iam not sure wheater i can use 'wc' for this purpose and will it procduce same output for ascii and ebcidic . (If iam not wrong, if its an fixed length record, i was under the impression that single line in ebcidic file may hold more than one ascii records.)
regards
kumar
Yes, you can use 'wc'. EBCDIC (only one 'eye') isn't magic or something that totally changes How Everything Works, it is just another character set and doesn't - in and of itself - change what a 'record' is or how they are read and/or handled.kumar_s wrote:My point in ebcidic format is - if its in ascii i can manage to read the header and use head command till n-1. But iam not sure wheater i can use 'wc' for this purpose and will it procduce same output for ascii and ebcidic
Now, if you are working with a fixed-width file with no record terminators (like something in the past that would have come off a mag tape or some such) then you'll have issues regardless at the O/S level, but for now... why not just try it and see what happens?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hmm..., that's exactly the point.
You said that you were using the CFF stage, right?
Have you read the functional description of what a CFF does?
In COBOL, the REDEFINES clause allows different layout structures for records contained in the same file.
See if you can obtain the COBOL FD for the file that you are attempting to read. Import it into Table Definitions. Then use it with your CFF.
Carter
You said that you were using the CFF stage, right?
Have you read the functional description of what a CFF does?
In COBOL, the REDEFINES clause allows different layout structures for records contained in the same file.
See if you can obtain the COBOL FD for the file that you are attempting to read. Import it into Table Definitions. Then use it with your CFF.
Carter
kumar_s wrote:Hi Carter,
The layout structure for trailier and detail is quite different. The record length also varies.
So basically i cant use trailer or header layout in the usage of detial records. Hene if detial layout reaches the trailer record it throws warning.
Hi dsrules,
Since this is an ebcidic file, we cant preprocess in unix.
regards
kumar
HI Craig,
Correct me if iam wrong.
When i use the following command
it take some time and gives me 0 as result.
when i use
It gives me 175500000 as result
Hence i was in impression that wc command in unix cannot find the record delimiter in ebcidic file and hence it cant be useful.
But let me know if iam making some mess somewehre.
If you need, i can give the screen prints of the above.
regards
kumar
Correct me if iam wrong.
When i use the following command
Code: Select all
wc -l <filename>
when i use
Code: Select all
ls -lart <filename>
Hence i was in impression that wc command in unix cannot find the record delimiter in ebcidic file and hence it cant be useful.
But let me know if iam making some mess somewehre.
If you need, i can give the screen prints of the above.
regards
kumar
No, that's fine. If you have no record terminators then you won't be able to use things like 'head' or 'tail' to trim out headers or trailers and will need to let the CFF stage do it for you. Carter has been trying to drive that point home.
All I was trying to point out is that EBCDIC and record/line terminators are not mutually exclusive. So your statement is more properly reworded to say: "Hence i was in impression that wc command in unix cannot find the record delimiter in this particular EBCDIC file and hence it can't be useful." True. In this case.
All I was trying to point out is that EBCDIC and record/line terminators are not mutually exclusive. So your statement is more properly reworded to say: "Hence i was in impression that wc command in unix cannot find the record delimiter in this particular EBCDIC file and hence it can't be useful." True. In this case.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
One other attempt...
USUALLY, if a mainfram file has different record types (Header, Detail, Trailer) there is a common column, USUALLY the first or second one, that says what type of record it is. (but you mentioned there are no REDEFINES in the copybook, which is really odd. Are you SURE you have the complete copybook member for defining your input file?)
Do you see such a column?
If so, the "Selection Criteria" tab on the CFF stage, at least on Server, lets you test for a value in a column and pass only those rows down the link.
Any such luck?
USUALLY, if a mainfram file has different record types (Header, Detail, Trailer) there is a common column, USUALLY the first or second one, that says what type of record it is. (but you mentioned there are no REDEFINES in the copybook, which is really odd. Are you SURE you have the complete copybook member for defining your input file?)
Do you see such a column?
If so, the "Selection Criteria" tab on the CFF stage, at least on Server, lets you test for a value in a column and pass only those rows down the link.
Any such luck?
Hi
Iam not good in Cobol. I have trailer and header layout but not conditional check it. The first letter for header is 'H' and trailor is 'T'. Is there any way i get to know hot to chaange the layout to check the first letter and fit into the given layout.
Or is there a any way to do it directly in CFF stage.
regards
kumar
Iam not good in Cobol. I have trailer and header layout but not conditional check it. The first letter for header is 'H' and trailor is 'T'. Is there any way i get to know hot to chaange the layout to check the first letter and fit into the given layout.
Or is there a any way to do it directly in CFF stage.
regards
kumar