Larry_Jones
Legendary Poster
Chris,
Here is how I implemented a 'ReadTextLine' function as originally described by Zoltan.
1. In OMW Copy Data Structures D34A1010A,B,C to D55A1010A,B,C
2. Create New Data Structure - D55A1010D as follows:
cSuppressErrorMessage Suppress ErrorMessage ->
cErrorCode ErrorCode <-
szErrorMessageId DataItem <-
idFilePtr GenericLong ->
szRecord VariableLengthField1 <-
2. in OMW create a new BSFN - call it B55A1010 - that mirrors B34A1010:
- Function Names almost same as in B34A1010 but change 'Flat' to 'Text' (you may want to append '55' also)
- New Function - ReadTextLine
- uses above new Data structures for functions
3. Edit BSFN B55A1010 source - copying code from B34A101.c and .h and changing as appropriate to new function names, etc. Add Code for new function - ReadRextLine.
See attached source code for B55A1010.c and .h
Regards,
Larry
<original Post shown below>
----------------------------------------------------------------------
I was most interested is in a some postings on JDELIST by yourself and Zoltan Gyimesi.
They listed under 'Raading Dynamic Flat Files' and discussed the addition of a 'ReadNextLine' function to B34A1010.
We have long wanted to input text files 'line by line' into our own UBE's, but have found no simple standard JDE solution.
We currently have to endure the inconvenience and limitations of Table
Conversion.
Being a absolute novice C programmer, and being totally unfamiliar with JDE C conventions, I was hoping you might be able give us some pointers as to how to implement 'ReadNextLine'.
It seems to me that the existing 'OpenFlatFile' would need a new option to open in Read Mode. Could the new 'ReadNextLine' be based on the existing 'WriteOneLine', basically by using 'fscanf' in place of 'fprintf' ? Would a new data structure be needed in the header file ?
Did you end up copying B34A1010 into the user name range (eg B55A1010) and modifying that copy ?
If so, did you have to change the existing Business Function names in that copy (eg WriteOneLine) to be unique ?
Would you recommend that the new program only be used for 'OpenForInput' and 'ReadNextLine', while B34A1010 continue to be used for 'WiteOneLine' and 'CloseFlatFile' ?
Any advice and warnings you may care to provide would be most appreciated.
__________ __________ __________ __________ ______
Chris Vaughan Phone: 03 8603 1458 (BH)
ICT Applications Architecture 0409 199 735 (M)
PWC BPO Holdings Australia 03 8603 1482 (FX)
Larry Jones
[email protected]
OneWorld XE, SP 15.1
HPUX 11, Oracle SE 8.1.6
Mfg, Distribution, Financials
Here is how I implemented a 'ReadTextLine' function as originally described by Zoltan.
1. In OMW Copy Data Structures D34A1010A,B,C to D55A1010A,B,C
2. Create New Data Structure - D55A1010D as follows:
cSuppressErrorMessage Suppress ErrorMessage ->
cErrorCode ErrorCode <-
szErrorMessageId DataItem <-
idFilePtr GenericLong ->
szRecord VariableLengthField1 <-
2. in OMW create a new BSFN - call it B55A1010 - that mirrors B34A1010:
- Function Names almost same as in B34A1010 but change 'Flat' to 'Text' (you may want to append '55' also)
- New Function - ReadTextLine
- uses above new Data structures for functions
3. Edit BSFN B55A1010 source - copying code from B34A101.c and .h and changing as appropriate to new function names, etc. Add Code for new function - ReadRextLine.
See attached source code for B55A1010.c and .h
Regards,
Larry
<original Post shown below>
----------------------------------------------------------------------
I was most interested is in a some postings on JDELIST by yourself and Zoltan Gyimesi.
They listed under 'Raading Dynamic Flat Files' and discussed the addition of a 'ReadNextLine' function to B34A1010.
We have long wanted to input text files 'line by line' into our own UBE's, but have found no simple standard JDE solution.
We currently have to endure the inconvenience and limitations of Table
Conversion.
Being a absolute novice C programmer, and being totally unfamiliar with JDE C conventions, I was hoping you might be able give us some pointers as to how to implement 'ReadNextLine'.
It seems to me that the existing 'OpenFlatFile' would need a new option to open in Read Mode. Could the new 'ReadNextLine' be based on the existing 'WriteOneLine', basically by using 'fscanf' in place of 'fprintf' ? Would a new data structure be needed in the header file ?
Did you end up copying B34A1010 into the user name range (eg B55A1010) and modifying that copy ?
If so, did you have to change the existing Business Function names in that copy (eg WriteOneLine) to be unique ?
Would you recommend that the new program only be used for 'OpenForInput' and 'ReadNextLine', while B34A1010 continue to be used for 'WiteOneLine' and 'CloseFlatFile' ?
Any advice and warnings you may care to provide would be most appreciated.
__________ __________ __________ __________ ______
Chris Vaughan Phone: 03 8603 1458 (BH)
ICT Applications Architecture 0409 199 735 (M)
PWC BPO Holdings Australia 03 8603 1482 (FX)
Larry Jones
[email protected]
OneWorld XE, SP 15.1
HPUX 11, Oracle SE 8.1.6
Mfg, Distribution, Financials