Input Flat File

Sejal04

Active Member
Hello!

I have a custom UBE that reads a flat file (comma delimited) record using B76B0220 and I parse it using function B76V0015 (Finds a char position in a string). I have four segments that I try to parse and the last one is an amount field. The problem is when I parse the last segment, along with the amount value it adds "10" or "LF" to that field (I noticed that in C debug) and therefore, my business function that converts string to numeric returns a value of 0. How can I overcome this issue where it doesn't append the end of line indicator or line feed to my last column?

My client is on E9.10, Tools 9.12.2 and SQL2008.

Any help will be appreciated.

Thanks,

Sejal
 
LF is a new line feed in the text

I guess if you know when it's happening you could just remove the last 2 digits of the extracted string

There is a BSFN to do this Strip Hex and Blanks B7900008 (only 300 long) there is another module in there Strip Hex and Blanks 30000 Var (30000 long)

If you need longer just copy that BSFN and extended the DSTR field
 
On the UBE driving section for each expected column in order, I call a simple conditional non-visible section (effectively acting as a function) that uses a global variable of the text file string in a while loop to construct the next field value character by character until the next comma or max length of the string, and passes back that value as another global variable.
Within that loop, you can ignore or process whatever characters you want (i.e. only copy a-z, A-Z, 0-9)

B76V0015 Find Character in String does basically the same thing as my simple WHILE loop and doesn't really save you any coding. My "function" section is about 20 lines of code, and each call to it is a single "call conditional section" and no parameters.

If you wanted to go all out for performance, I would create a C BSFN to chop up the whole string at once, with a data structure containing the input string as input and all the expected columns as output. But then again, I could actually do all that with 2 UBE "function" sections as well.

I don't see much gained using generic C function to process a single column at a time, and such string functions can be notoriously finicky running on different server environments.
 
Last edited:
Thanks John and David for your reply! John, I just used the function to strip Hex and blanks as you suggested and it worked like a charm.

Thanks again,

Sejal
 
please can someone tell how to use MD Debug function to debug NER?Its urgent
 
please can someone tell how to use MD Debug function to debug NER?Its urgent

1. Is this at all relevant to this thread?

2. If you need to debug an NER just debug the generated C code like you would any other C BSFN.

3. If the NER is client only and called from an APPL you wont be able to use MD Debug anyway... basically there is not any real use that I can think of for MD Debug.
 
please can someone tell how to use MD Debug function to debug NER?Its urgent

I agree with Brian but to answer your question.

MD Debug is a business function that can pop up a message screen when executed. You'll need to run the NER locally on a FAT client for a start.

It has many different input parameter variables that it will display (5 math fields, 5 strings etc)

You place the call to MD Debug in your code. Also pass in any variables you wish to see at the time. It also has a comment field to try and be more informative where it is in the code....

When the code flows over your MD Debug call up pops the screen
The user has to click OK to proceed

It is useful but dangerous if you leave it in the code

If you want to call your NER, do it locally, either create a new screen to call it or use JDE Object Browser
 
Back
Top