Open Flat File on iSeries

mmateus

Active Member
Hi All,

I am trying to use the OpenFlatFile (B34A1010) business functions to read a .csv file from the Integrated File System on an iSeries. When I run the UBE locally on a fat client, it works okay but as soon as I run it on the iSeries, I get a error code for the business function.

Has anyone perhaps had this error and managed to sort it out?

Below is the sample of code for each business function:

Open Flat File
"<Zero>" -> cSuppressErrorMessage
VA rpt_55_ErrorCode_ERRC <- cErrorCode
VA rpt_55_ErrorMessageID_DTAI <- szErrorMessageId
"1" -> cAppendMode
VA rpt_55_FilePtr_GENLNG <- idFilePtr
VA rpt_55_ServerPathFName_SERSHP -> szFilePath

Fetch Next Line from Flat File
VA rpt_55_ServerPathFName_SERSHP -> szFlatFileName
VA rpt_55_FilePtr_GENLNG -> idFilePtr
VA rpt_55_RecordString_CSTG <- szFlatFileRecord
"50" -> mnRecordLength
"1" -> cSuppressErrorMessage
VA rpt_55_ErrorCode_ERRC <- cErrorCode
VA rpt_55_ErrorMessageID_DTAI <- szErrorMessageID

Below is sample of the log where the business function bombs:

Oct 13 09:49:02 ** **********************************************************************************
Oct 13 09:49:02 ** *** Start dumping data structure for business function OpenFlatFile
Oct 13 09:49:02 ** **********************************************************************************
Oct 13 09:49:02 ** OUT->[ 1] <Item>: cSuppressErrorMessage <type>: CHAR <Value>: [0]
Oct 13 09:49:02 ** OUT->[ 2] <Item>: cErrorCode <type>: CHAR <Value>: [1]
Oct 13 09:49:02 ** OUT->[ 3] <Item>: szErrorMessageId <type>: STRING <Value>: [078D]
Oct 13 09:49:02 ** OUT->[ 4] <Item>: cAppendMode <type>: CHAR <Value>: []
Oct 13 09:49:02 ** OUT->[ 5] <Item>: idFilePtr <type>: ID <Value>: [0]
Oct 13 09:49:02 ** OUT->[ 6] <Item>: szFilePath <type>: STRING <Value>: [/ExchangeRates/SouthAfrica/F0015_20101013.csv]
Oct 13 09:49:02 ** **********************************************************************************
Oct 13 09:49:02 ** *** End dumping data structure for business function OpenFlatFile
Oct 13 09:49:02 ** **********************************************************************************
Oct 13 09:49:02 ** Return value is 2 for OpenFlatFile. (BSFNLevel = 1)
Oct 13 09:49:02 ** Entering JDB_OpenTable( Table = F0015)
Oct 13 09:49:02 ** Entering JDB_ClearSelection
Oct 13 09:49:02 ** Entering JDB_SetSelection
Oct 13 09:49:02 ** Exiting JDB_SetSelection With Success
Oct 13 09:49:02 ** Entering JDB_SetSequencing
Oct 13 09:49:02 ** Entering JDB_SelectKeyed

Thank you in advance for any help.

Kind regards,
Misael
 
XE does not utilize the IFS. You need to build a custom function or have the csv file put into your library or import folder.
 
Try using QNTC on the iSeries. Search this forum for QNTC and you should find some information about using it. You must have windows domain login that matches your iSeries JDE user login exactly: that means userid and password.
 
Back
Top