Page 1 of 1

Promote Subrecord stage

Posted: Wed Aug 25, 2010 2:50 pm
by FranklinE
I searched all the forums for anything on this error message, and got two hits that offered nothing about it beyond the mere mentioning of it.

It compiles cleanly. At runtime it dies on main_program: Fatal Error: Not an aggregate field. [api/schema/schema.C:2173], not one detail offered or found with every messaging environment variable I could find set to "true".

The OSH code from Director:
#### STAGE: Promote_Subrecord_200
## Operator
promotesubrec
## Operator options
-subrecname 'SFR1_REC'

## General options
[ident('Promote_Subrecord_200'); jobmon_ident('Promote_Subrecord_200')]
## Inputs
0< [] 'FLTR_RECTYPE:fltro_rectype_01.v'
## Outputs
0> [modify (
keep
SFR1_ID,SFR1_REC0,SFR1_REC1,SFR1_REC2,
SFR1_REC3,SFR1_REC4,SFR1_REC5,SFR1_REC6,
SFR1_REC7,SFR1_REC8;
)] 'Promote_Subrecord_200:spvo_rectype_01.v'
;
The _ID column is a pass-through column only. I've also tried this with dropping it and just having the one column with the same results.

Posted: Wed Aug 25, 2010 3:02 pm
by mhester
Would you be able to post the schema of the dataset used as input?

Posted: Wed Aug 25, 2010 3:20 pm
by FranklinE
mhester wrote:Would you be able to post the schema of the dataset used as input?
Thanks for asking. I should also add that I can use a Transformer stage and substring derivations without any problem. I do have a medium performance concern, or I wouldn't be trying to avoid using the Transformer.

-schema record
{record_length=fixed, delim=none, ebcdic, binary, fix_zero}
(
SFR_ID:string[2];
SFR_RECORD:string[98];
)

That's it. In case it also helps, the output schema:
-schema record
{record_length=fixed, delim=none, ascii, text, fix_zero}
(
SFR1_ID:string[2];
SFR1_REC0:decimal[10,0] {zoned, default=0};
SFR1_REC1:decimal[10,0] {zoned, default=0};
SFR1_REC2:decimal[6,0] {zoned, default=0};
SFR1_REC3:decimal[4,0] {zoned, default=0};
SFR1_REC4:decimal[4,0] {zoned, default=0};
SFR1_REC5:decimal[4,0] {zoned, default=0};
SFR1_REC6:decimal[2,0] {zoned, default=0};
SFR1_REC7:string[1];
SFR1_REC8:string[57];
)

Posted: Wed Aug 25, 2010 3:29 pm
by mhester
Thanks and by the looks of your input dataset schema you are not dealing with a subrec, but a normal dataset. In order to use the promote subrec operator you must have built a subrec.

The subrec is actually nothing that you can manipulate in the traditional way within your flow except to use other restructure stages with them.

If you can give me a bit more information regarding what you are attempting to accomplish I would be more than happy to help you out with possible solutions.

Posted: Wed Aug 25, 2010 3:45 pm
by chulett
mhester wrote:Sorry, did not mean to post that twice!
Unposted. :wink:

Posted: Wed Aug 25, 2010 3:53 pm
by mhester
Thanks for asking. I should also add that I can use a Transformer stage and substring derivations without any problem. I do have a medium performance concern, or I wouldn't be trying to avoid using the Transformer.
Actually glossed over this part, but I cannot think of too many reasons to avoid a transform - they are pretty speedy. The restructure stages obfuscate metadata and "can" make maintenance and understanding a bit more difficult. Also, these stages do not imply greater efficiency or performance, just a different tool in the toolbox :)

Posted: Thu Aug 26, 2010 6:43 am
by FranklinE
mhester wrote:...I cannot think of too many reasons to avoid a transform - they are pretty speedy. The restructure stages obfuscate metadata and "can" make maintenance and understanding a bit more difficult. Also, these stages do not imply greater efficiency or performance, just a different tool in the toolbox :)
Thanks, Mike. That's excellent advice considering that my other motivation was coding convenience. The restructure stages are simpler than the Transformer.

Posted: Thu Aug 26, 2010 6:52 am
by mhester
The restructure stages are simpler than the Transformer
Well said and I agree - nice to see folks actually using these stages :)

Posted: Thu Aug 26, 2010 6:53 am
by mhester
The restructure stages are simpler than the Transformer
Well said and I agree - nice to see folks actually using these stages :)

Posted: Thu Aug 26, 2010 6:54 am
by mhester
Ok - not sure why I get the double posts! I submitted only once!

Craig, do your magic and remove one please :)