In order to use any input/output fields they need to be mapped under the I/O Fields tab. The labels used must match the strings used in the get & set fields expressions. (this is also case sensitive)
it can be a bit quirky at first, but after a couple years you’ll get the hang of it.
Dear jlynn73,
Thank you for your reply! I’ve checked the case sensitivity against the I/O fields and python code. You are right! The problem was with the I/O field names. They were mis-speled in the record.GetField/SetField() methods. The warning message still persists but the job has successfuly run.
Hi
I experienced the following err when executing the job. I think the type casting from string to float was alright but I don’t know why I still get such an err.
The other thing is that how do I determine/specify the output data format? For example, if I want the floating point to be separated by . rather than ,.
Its always pleasing me to thank you in advance.
the error is telling you that the value you’re trying to assign has a comma in it, which make me think its still a string. When it tries to assign it to the receiving field of type float, it doesnt know what to do with that comma.
DS does some dynamic typing which automatically converts the result of an expression into the target data type. So it even if you cast a string field to a datatype of float, if the receiving field is a string… it will convert it back. Be my first guess.
Hey, I fixed the problem modifying the module like this:
#order_number is same as previous, populate customer_ID and sum revenue
elif dct[u'Order_Number'] == record.GetField(u'ORDER_NUMBER'):
prev_revenue = dct[u'RevenueSum']
cur_revenue = record.GetField(u'REVENUE')
dct[u'RevenueSum'] = unicode(str(float(prev_revenue.replace(',','.')) + float(cur_revenue.replace(',','.'))))
I added two local variables: prev_revenue and cur_revenue, which hold the previous & current revenue values. Then it was easy to find and replace the ‘,’ with ‘.’ using the replace method that in turn made it simple to convert string to float.
Check that your browser is configured to use a proxy server and that only that proxy server has access to the DMZ and the wider Internet?
Python 2.6.2, which Data Services uses, does not support tunnelling and will basically only work when a direct connection between the job server and the target web service/webserver/IP address.
We had a similar issue at another client, raised a SAP support call for this and SAP provided us with 2 replacement Python libraries for httplib and urlib2 - I believe these were taken from the Python 2.6.3 distribution which does support network tunnelling.