Can datastage read input from the source conditionally? That is, can it make a 'decision' to read or not read the line based on the value of a field in the current line. I know some programming languages have the capability to do this.
Recently, I was told datastage would read its input completely and then a 'decision' can be made only in the consequent stages. Is this true?
Reading input conditionally
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 6
- Joined: Mon Aug 02, 2010 2:38 pm
Reading input conditionally
I am what I am, even when I am not myself.
Seems to me you'd have to read the record first to get the value in the field to make this decision on.
Regardless, to answer your generic question, yes - entire records are read and then decisions on how the parse different layouts can be made after that in subsequent stages. As an 'additional info' note, the ability to read 'mainframe files with different record layouts' is built into the CFF (Complex Flat File) stage.
Regardless, to answer your generic question, yes - entire records are read and then decisions on how the parse different layouts can be made after that in subsequent stages. As an 'additional info' note, the ability to read 'mainframe files with different record layouts' is built into the CFF (Complex Flat File) stage.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 6
- Joined: Mon Aug 02, 2010 2:38 pm
Thank you, Craig! I checked the documentation for the mainframe file stages and found it can read multiple 'occur depending on'(though our developer insists 8.1 cannot ). Now, my mainframe file has different record layouts within the same file and the header record tells me the following records are of some particular layout. I would have to read in my header record and accordingly, change layout!
Can I do the decision making if I read the file in sequentially?
Can I do the decision making if I read the file in sequentially?
I am what I am, even when I am not myself.
-
- Participant
- Posts: 6
- Joined: Mon Aug 02, 2010 2:38 pm
Without knowing the details, the following criti... um, commentary should be taken with a grain of salt.
Number one: Using a single dataset to contain variable-length/blocked records with multiple data definitions (schemas, copybooks) is insane. It's lazy design to avoid making the coders do standard work. It's just sane to use fixed-width records on a consistent schema (copybook).
The only reliable way to read mainframe data into DataStage is to import that consistent schema. If you have mutiple record types identified in the first 1 or 2 bytes, you can use a filter or transformer contraint to use or skip them accurately.
Number one: Using a single dataset to contain variable-length/blocked records with multiple data definitions (schemas, copybooks) is insane. It's lazy design to avoid making the coders do standard work. It's just sane to use fixed-width records on a consistent schema (copybook).
The only reliable way to read mainframe data into DataStage is to import that consistent schema. If you have mutiple record types identified in the first 1 or 2 bytes, you can use a filter or transformer contraint to use or skip them accurately.
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
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact: