Complex Flat File with Occurs in the table

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
karthegx
Participant
Posts: 27
Joined: Wed Sep 06, 2006 1:48 am

Complex Flat File with Occurs in the table

Post by karthegx »

Hi Guys,

I unable to find a way to derive this in the complex flat file . Below is the copy book

01 C-MSG-DTA-PORT-MRK.
10 C-MSG-DTA-PORT-MRK-TBL OCCURS 10 TIMES
INDEXED BY PORT-SUB.
15 C-SHP-ORD-CTL-NO PIC X(9).
15 C-PORT-MRK-LN-NO PIC 9(3).
15 C-PORT-MRK-TXT PIC X(40).
05 FILLER PIC X(274).

How can we achieve this ? Thanks in Advance

Kartheek
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Where is PORT-SUB defined?

Import the table definition from the FD.
Load the imported table definition into the Complex Flat File stage.
You can specify whether you want the OCCURS handled by creating a vector within a single column or by creating ten separate columns (flattening).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

ray.wurlod wrote:Where is PORT-SUB defined?
Ray, in Cobol the index for OCCURS clauses is defined simply by using the clause. It is managed (as it were) by the compiler, and my sieve-like memory says that it only appears in the Assembled code as a register.

I'm not completely sure, but I believe it is similar to 88-level items.

It has a dedicated key-word, SET, to manipulate its value.
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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Most of the ones I've seen have the value as a second-level (level 10 in this example) item.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

My COBOL/2 reference reminds me that indexing was a later innovation, but it didn't "retire" the original subscript usage. If the code contains an explicit variable for referencing the occurance, it is labelled a "subscript" and can be manipulated like any numeric field. I've seen code where the subscript was a better choice, since it might be used in more than one place.

It's like mixed metaphors. We can never be sure what the original intentions were. :lol:
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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sorry, I was thinking of OCCURS DEPENDING ON.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So the index value is not really relevant - it's documentation only as far as a DataStage developer is concerned.

If you bring in the multi-valued field as a vector, then the vector will have an integer index of some kind automatically in DataStage, though the first element of the vector is position 0.

If you bring in the multi-valued field as separate columns, there will be ten of these.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply