Hi all,
I have to match two datasets (FB200) and:
- if the key is present only in the first dataset, I have to write the record in AM28.DOP0GF.TS000.CONTRADI.GFMBF manipulating data
- if the key is present only in the second dataset, I have to write the record as is in AM28.DOP0GF.TS000.CONTRADI.GFMBF
- if the key is present on both datasets, I have to subtract dataset2.campoA from dataset1.campoA: if the result is >= 0 I have to write a record in AM28.DOP0GF.TS000.CONTRADI.GFMBF inserting the result of subtracting in a certain position; if the result is < 0 I have to write a record in AM28.DOP0GF.TS000.CONTRADI.GFMBF inserting the subtraction result in a certain position.
WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED
WER903I SYNCSORT 2.1.0.0 IS NOT LICENSED FOR SERIAL 31BE7, TYPE 2964 718, LPAR
WER903I PRODUCT WILL STOP WORKING IN 44 DAYS UNLESS A VALID KEY IS INSTALLED.
WER251A INCLUDE/OMIT INVALID COND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
is there a syntax error or, with the sort, I can not do what previously described?
Joined: 09 Mar 2011 Posts: 7310 Location: Inside the Matrix
Quote:
is there a syntax error or, with the sort, I can not do what previously described?
Well, both. Because you cannot do that in the manner you are attempting, you obviously are creating a syntax error when you attempt to do so. You can't have an expression in a condition.
You have to do the calculation before the test, storing the result in an extension to the record, and then use that field in the condition. Use IFTHEN=(WHEN=INIT for this.
You have to ensure that the extension does not persist on your output. Since you already have BUILD to get the data from the REFORMAT record, that should not be a problem, you won't need to do anything extra.
in effect, to obviate this problem, I modified IFTHEN so that writes the subtraction result in the same position and, in a next job step, I controlled if in that location the value is positive or negative: in the first case I leave everything so while in the second I overturn the value in another field.