Detecting a layout
Hello, I hope someone can help with this. Any way we can detect an input file's layout before performing the next operation. Let's say the vendor sends a monthly file but sends it with two different layouts without warning. How can I ask the compiler to make a decision based on the input layout with ECL code?
- mo0926
- Posts: 18
- Joined: Thu Jan 09, 2020 3:57 pm
mo0926,
It's not the compiler, but the runtime that needs to know.
You write your code to handle either, then you could read the first 32K of the file with a RECORD structure like this:
HTH,
Richard
It's not the compiler, but the runtime that needs to know.
You write your code to handle either, then you could read the first 32K of the file with a RECORD structure like this:
- Code: Select all
rec := RECORD
DATA1 char;
END;
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1619
- Joined: Wed Oct 26, 2011 7:40 pm
Also read up section
'RECORD Structure' in the ECL reference manual.
In there you'll see an
IFBLOCK construct you can use in a RECORD layout.
This IFBLOCK is a run time action conditional on content of preceding fields in the same record.
Yours
Allan
'RECORD Structure' in the ECL reference manual.
In there you'll see an
IFBLOCK construct you can use in a RECORD layout.
This IFBLOCK is a run time action conditional on content of preceding fields in the same record.
Yours
Allan
- Allan
- Posts: 444
- Joined: Sat Oct 01, 2011 7:26 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 1 guest