E9.0 Flat File Folder path validation

kiran4hari

kiran4hari

Well Known Member
Hi,

I have a requirement to write flat files to a folder specified in processing option, this folder will be on a Windows server. Before I start processing the selected records, I need to add logic to validate the path in initialize section. I am not able to find any relevant business function that does this validation. The closest I found is Open Flat File (B34A1010), but to use this I need to create a temporary file and then delete it if file opens successfully. Is there any other way I can implement this logic?

Thank you.
 
This checks files but not folders, maybe you could do that? Is the file there?

Code:
CheckForFile(B0500725.CheckForFile)
    VA evt_Integer01 [INT01] <- nReturnCode [INT01]
    VA evt_FileAddress_CMDS [CMDS] -> szFullFileName [MMFN]

If VA evt_Integer01 [INT01] is equal to "1"
   VA evt_cFileExists_EV01 [EV01] = "1" (found)
Else
   VA evt_cFileExists_EV01 [EV01] = <Blank> (not found)
End If

The // folder address needs to be mapped to yor E1 server or it'll never work
 
Last edited:
This checks files but not folders, maybe you could do that? Is the file there?

Code:
CheckForFile(B0500725.CheckForFile)
    VA evt_Integer01 [INT01] <- nReturnCode [INT01]
    VA evt_FileAddress_CMDS [CMDS] -> szFullFileName [MMFN]

If VA evt_Integer01 [INT01] is equal to "1"
   VA evt_cFileExists_EV01 [EV01] = "1" (found)
Else
   VA evt_cFileExists_EV01 [EV01] = <Blank> (not found)
End If

The // folder address needs to be mapped to yor E1 server or it'll never work
Thank you John, I tested this function in Object browser and it worked fine. It did look like it validates only files. But it worked for folders as well. Returned 1 for Found and blanks for not found. Thanks a lot.
 
Hi,

I have a requirement to write flat files to a folder specified in processing option, this folder will be on a Windows server. Before I start processing the selected records, I need to add logic to validate the path in initialize section. I am not able to find any relevant business function that does this validation. The closest I found is Open Flat File (B34A1010), but to use this I need to create a temporary file and then delete it if file opens successfully. Is there any other way I can implement this logic?

Thank you.

Hi Kiran,

The list below is from a post I wrote some 12 years ago, but I think it is still valid. It lists most of the business functions I used to to work with flat/text files from within JDE, before I retired 2 years and 4 days ago. It includes the business function ExecuteExternalProgram which can run batch files on the system OS under the system user ID under which JDE is running.

Here is a link to the thread which included my post, it will provide more information for you: External File Processing

Below are most of the standard business functions I use for working with Flat/Text files. None are client only. I use them on Windows and Unix computers. I do not know about the AS/400. They all exist in E811 sp1 (TR 8.97.2.1) and I would expect that most would exist probably back to Xe or before.

Function Name:; OpSysFileOperations
Souce Module: B0500180
Description: Operating System File Operations Delete, Rename, File Exists

Function Name:; GetNewLineCharacter
Souce Module: B0800207
Description: Get New Line Character

Function Name:; CloseFlatFile
Souce Module: B34A1010
Description: Close Flat File

Function Name:; OpenFlatFile
Souce Module: B34A1010
Description: Open Flat File

Function Name:; WriteOneLine
Souce Module: B34A1010
Description: Write One Line To Flat File

Function Name:; ExecuteExternalProgram
Souce Module: B34A1030
Description: Execute External Program

Function Name:; DeleteOrCopyFlatFile
Souce Module: B4700230
Description: Delete Or Copy Flat File

Function Name:; ConvertCRLFtoHex
Souce Module: B7400150
Description: Convert CR And LR to Hexadecimal

Function Name:; AppendLineToFlatFile
Souce Module: B76B0220
Description: Append Line to Flat File

Function Name:; FetchNextLineFromFlatFile
Souce Module: B76B0220
Description: Fetch Next Line from Flat File
 
Back
Top