Class SY_File

Inherits

*dict/pvxdb, SY_Constant, SY_OpenObject

Properties

LOCAL cPRPrefix$="PR"  
LOCAL cSystemModules$="SY, CM, CU, MD, PL, VI, "  
PROPERTY LastErrorMsg$   * Read Only *
PROPERTY LastErrorNum$   * Read Only *
PROPERTY DclIOL$   * Read Only *

Methods

FUNCTION CacheColumns(file$)  
FUNCTION Copy(srcFile$, srcPath$, dstFile$, dstPath$)  
FUNCTION Copy(srcFile$, srcPath$, dstFile$, dstPath$, useDict)  
FUNCTION Copy(srcFile$, srcPath$, dstFile$, dstPath$, useDict, useSqlKeys)  

Function to copy a file or SQL table. This method always overwrites. The Dictionary determines if a file or SQL table is copied. Use CopyPvxToSql() & CopySqlToPvx() to copy a file to a SQL table and vis-a-vis.

ParameterDescription
srcFile$ [input, string] File or Table to copy from.
srcPath$ [input, string] Path constant for the copy source - pthOTHERCOMPANY$+compCode$, pthSYSTEM$, etc.
dstFile$ [input, string] File or Table to copy to.
dstPath$ [input, string] Path constant for destination table - pthOTHERCOMPANY$+compCode$, pthSYSTEM$, etc.
useDict {optional} [input, boolean] Flag to use dictionary schema for destination table. Default: False. Source table schema is used for destination table (uses direct file copy or SQL INSERT * INTO)
useSqlKeys {optional} [input, boolean] Flag to not use dictionary key definition for destination table. Default: False. Set to true to use the source table's SQL key definition for the destination table.
Returns [boolean]
ValueDescription
retFAILURE (0) - if a problem was encountered.
retSUCCESS (1) - if the file or table was copied successfully.
FUNCTION CopyPvxToSql(table$, srcPath$, dstPath$, overwrite)  
FUNCTION CopySqlToPvx(table$, srcPath$, dstPath$, overwrite)  
FUNCTION Create(file$, path$)  
FUNCTION Create(file$, path$, wdxFlag)  
FUNCTION Create(file$, path$, wdxFlag, ddfTableName$)  
FUNCTION Create(file$, path$, wdxFlag, ddfTableName$, createPVX)  
FUNCTION Create(file$, path$, wdxFlag, ddfTableName$, createPVX, applyConstraints)  
FUNCTION CreateSerialFile(file$, path$, wdxflag, overwrite)  
FUNCTION DropFile(file$, path$)  
FUNCTION DropFile(file$, path$, wdxFlag)  
FUNCTION DropFile(file$, path$, wdxFlag, ddfTableName$)  
FUNCTION DropFile(file$, path$, wdxFlag, ddfTableName$, dropPVX)  
FUNCTION FileExists(file$)  
FUNCTION FileExists(file$, path$)  

Function to check if a file exists in the given path. (files only - for SQL tables use SY_SQL'TableExists()

ParameterDescription
file$ [input, string] The full name (including file extension) to check. Ex. AR_Customer.M4T
path$ {optional} [input, string] Specify the full or reletive path, or may use path constants for standard Sage 100 files. If path is blank, standard Sage 100 file/path is assumed. Ex. AR_Customer.M4T will assume pthCOMPANY$
Returns [Boolean]
ValueDescription
retFAILURE (0) - file was not found
retSUCCESS (1) - file was found
FUNCTION FlushCache()  
FUNCTION GenerateKDF()  
FUNCTION GenerateKDF(pathDDF$)  

Function to generate or re-generate the Providex.KDF (SQL key definition) file. The existing file is erased, a new file is created from the dictionary.

ParameterDescription
pathDDF$ {optional} [input, string] Specify the dictionary path. The value of the BasePath$ is the default.
Returns [Boolean]
ValueDescription
retFAILURE (0) - An error occurred generating the Providex.KDF file
retSUCCESS (1) - The Providex.KDF file was generated successfully
FUNCTION GetColumnCount(file$)  
FUNCTION GetColumnInfo(file$, column$)  
FUNCTION GetColumnInfo(fileHandle, columnNo)  
FUNCTION GetColumnLength(file$, column$)  
FUNCTION GetColumnName$(file$, column)  
FUNCTION GetColumnVariable$(file$, column$)  
FUNCTION GetDictExtn(entity$, name$, extn$, val)  
FUNCTION GetDictExtn(entity$, name$, extn$, val$)  
FUNCTION GetEncryptedColumnList$(table$)  
FUNCTION GetEncryptedColumnList$(table$, context$)  

Function that returns the list of encrypted columns for a table. @ param table$ [input, string] Name of table to retrieve encrypted columns.

ParameterDescription
context$ {optional} [input, string] Context ('C'ustomer / 'V'endor) of consumer PII columns list to retrieve
Returns [string] The list of encrypted column names sorted by extn.EncryptSeqNo
FUNCTION GetFileSegment(filepath$)  

Function to check if a file is a multi-segmented pvx data file

ParameterDescription
filepath$ [input, string] Full path and filename
Returns [Numeric] Number of file segments
FUNCTION GetRecordName$(file$)  
FUNCTION GetSystemTableListByModule$(module$)  

Returns the list of tables defined as system tables named with a module prefix.

ParameterDescription
module$ [input, string] Module prefix or code to return the table list for.
Returns [string] The list of table names that match the specified module.
FUNCTION GetTableCount()  
FUNCTION GetTableList$()  
FUNCTION GetTableListByGroup$(group$)  
FUNCTION GetTableName$(count)  
FUNCTION GetTablePath$(table$)  
FUNCTION GetTablePath$(table$, company$)  

Returns one of three path constants based on the data dictionary (physical path information) OR the first two characters of the table name

ParameterDescription
table$ [input, string] Table name used to query the dictionary
company$ {optional} [input, string] Specify a company code, or leave blank to assume the current company in the session object.
Returns [String]
ValueDescription
pthSYSTEM$ ("SYSTEM") - If the table is found in the dictionary with a path of MAS_SYSTEM, or if not found and the table name begins with "sy"
pthCOMPANY$ ("COMPANY") - (no company specified) If the table is found in the dictionary without a path of MAS_SYSTEM, or if not found and the table does not begin with "sy"
pthOTHERCOMPANY$+company$ ("COMPANY:"+company$) - Same as pthCOMPANY$ for a specific company
FUNCTION GetWrkTableDDFName$(wrkTable$)  
FUNCTION InitDBManager()  
FUNCTION IsSqlTable(tableName$)  
FUNCTION Open(file$, path$)  
FUNCTION Open(file$, path$, option)  
FUNCTION Open(file$, path$, option, wdxFlag)  
FUNCTION Open(file$, path$, option, wdxFlag, opt$)  
FUNCTION Open(file$, path$, option, wdxFlag, opt$, ddfTable$)  
FUNCTION OpenTempFile(baseName$, keyDef$, fileIolist$, recSize, useGlobalChan, useMemoryFile)  
FUNCTION OpenTempFile(baseName$, keyDef$, fileIolist$, recSize, useGlobalChan)  
FUNCTION OpenTempFile(baseName$, keyDef$, fileIolist$, recSize)  
FUNCTION OpenTempFile(baseName$, keyDef$, fileIolist$)  
FUNCTION OpenTempFile(baseName$, keyDef$)  
FUNCTION OpenTempFile(baseName$)  

Create and open temporary file on disk as alternate to using a memory file (created in user TEMP folder); if temporary file cannot be created/opened, a memory file will be used instead

ParameterDescription
baseName$ [input, string] Base name to use for file; will add company code and a timestamp to create actual name for temporary file
keyDef$ [input, string] {optional} Key definition to use when creating the temporary file
fileIolist$ [input, string] {optional} IOLIST to use when opening the temporary file
recSize [input, int] {optional} Record size to use when creating the temporary file; for memory files this will be the BSZ value
useGlobalChan [input, boolean] {optional} When set to isTRUE (1) the file will be opened on a global channel
useMemoryFile [input, boolean] {optional} When set to isTRUE (1) amemory file will be used instead of a file on disk
Returns fileHandle if file is successfully created and opened; otherwise returns zero
FUNCTION PadKeyFields$(channel, values$)  
FUNCTION PadKeyFields$(channel, values$, kno$)  
FUNCTION PadKeyFields$(channel, values$, kno$, noForcePad)  

Pads a SEP separated list of key valuse to the correct column length according to the key information retrieved from the file handle.

ParameterDescription
channel [input, numeric] channel the file is open on
values$ [input, string] SEP-separated list of values that correspond to each key component (ie, "01"+SEP+"ABF")
kno$ {optional} [input, string] Key number - must be passed in as string (ie, "kCUSTOMER") or string numeric (ie, "1"). Default KNO is the current KNO in use on the channel
noForcePad {optional} [input, boolean] Set this to consider max length column values as padded.
Returns [string]
ValueDescription
Nul-padded key value
FUNCTION ParsePath$(path$)  
FUNCTION Rename(table$, newTable$)  
FUNCTION Rename(table$, newTable$, path$)  
FUNCTION Rename(table$, newTable$, path$, option)  
FUNCTION ReturnTableName$(channel)  
FUNCTION ReturnTableName$(channel, includeExtension)  
FUNCTION SetChannel(channel)  
FUNCTION SetDatabase(dbPath$)  
FUNCTION SQLAllowNullDates(tableName$)  
FUNCTION UpdateKDF(table$)  
FUNCTION UpdateKDF(table$, pathDDF$)  

Function to create or update the key definition record in the Providex.KDF file for a SQL table.

ParameterDescription
table$ [input, string] The table to update the key definition for.
pathDDF$ {optional} [input, string] The dictionary path. The value of the BasePath$ is the default.
Returns [Boolean]
ValueDescription
retFAILURE (0) - An error occurred updating the Providex.KDF file
retSUCCESS (1) - The Providex.KDF file was updated successfully
FUNCTION Updatetable(table$, path$, columnActions$)  
FUNCTION ValidateDatabase(companycode$)  
FUNCTION ValidateDatabase(companyCode$, createDatabase)  
FUNCTION ValidateDirectory(path$)  
FUNCTION ValidateDirectory(path$, createDir)  

Properties inherited from: SY_Constant

retFAILURE, retSUCCESS, retNEW, retWARNING, retCANCEL, retYES, retNO, msgYES$, msgNO$, msgCANCEL$, msgOK$, msgRETRY$, msgABORT$, msgIGNORE$, msgNOTONFILE$, msgTIMEOUT$, msgDISABLE, msgACTIVE, msgLinkHELP$, msgLinkMSG$, isFALSE, isTRUE, isYES$, isNO$, isBUSY$, edtNONE, edtEXISTS, edtNEW, ctlDISABLE, ctlENABLE, ctlSHOW, ctlHIDE, ctlLOCK, ctlUNLOCK, ctlLOCKORDISABLE, ctlUNLOCKORENABLE, popHIDE, popDISABLE, popSHOW, popSHOWCHECKED, grdMODEVIEW, grdMODEMAINT, grdMODEADD, filCREATE, filLOCK, filCREATELOCK, filGLOBAL, filCREATEGLOBAL, filLOCKGLOBAL, filCREATELOCKGLOBAL, filCHANNEL, filRAW, filPURGE, filLOAD, filINPUT, filNOOBJECT, filPVX, filREFRESH, filPVX4$, filPVX5$, pthCOMPANY$, pthOTHERCOMPANY$, pthPRCOMPANY$, pthOTHERPRCOMPANY$, pthSYSTEM$, pthUSER$, pthSOA$, pthHOME$, pthROOT$, pthDICTIONARY$, pthTEXTOUT$, pthLOCK$, pthLOCKSYS$, pthPREFIX$, pthARCHIVE$, pthLOGFILES$, folderCOMMONPROGRAMFILES, folderCOMMONAPPLICATIONDATA, errOBJECT, errSYSTEMLOCK, errCONTINUE, errEMBEDDEDIO, errSYSLOCK, extSQLCREATETABLE$, extSQLALLOWNULLDATES$, dbALL$, dbNONE$, dateTOSTRINGFORMAT$, dateLONGMASK$, dateSHORTFMT, dateLONGFMT, dateYEARFIRST, dateMONTHFIRST, dateDAYFIRST, timeMINUTESMASK$, timeMINUTES24MASK$, timeSECONDSMASK$, timeSECONDS24MASK$, idxPRIMARY$, idxBATCH$, idxDISPLAY$, dirFIRST, dirLAST, dirNEXT, dirPREVIOUS, typALPHANUM, typZEROFILL, typCHARNUM, typMASTERNUM, typALPHANUMNF, typMASTERNUMC, typALPHA$, typNUMBERS$, typALPHANUM$, typALPHANUMNF$, typCHARNUM$, typMASTERNUM$, typMASTERNUMCLEN, modTASKOTFDISALLOW$, logALLACTIVITY$, logACTIVITY$, logERROR$, logACTNEWCUSTOMER$, logACTDATASYNC$, logACTDATAIMPORT$, logACTOPTIONCHANGED$, logACTPROGRAMLAUNCH$, logDFDM$, logSECURITY$, logTASKSCHEDULER$, logWEBERROR$, logVISUALINTEGRATOR$, logEntryIDLength, chkOFF$, chkON$, chkGRAYED$, secVIEWONLY, secCREATEONLY, secMODIFYONLY, secCREATEMODIFY, secDELETEONLY, secCREATEDELETE, secMODIFYDELETE, secFULLACCESS, secDEFAULTUSER$, secDEFAULTROLE$, regHKEY_CLASSES_ROOT, regHKEY_CURRENT_USER, regHKEY_LOCAL_MACHINE, regHKEY_USERS, regHKEY_CURRENT_CONFIG, regODBC_PATH$, regMAS_PATH$, E3_MYHANDLE, E3_TASK, E3_QUIT, E3_COCHANGE, E3_DATECHANGE, E3_USERCHANGE, E3_SRVRPATH, E3_HELPFILE, E3_TECHSUPPORT, E3_QUERYTOQUIT, E3_SUPERVISOR, E3_CUSTOMIZE, E3_SWITCHMODULE, E3_DISABLEWIN, E3_CURSOR, E3_USERID, E3_PRIVATETASK, E3_CHAT, E3_BROADCAST, E3_RELOAD, E3_PASSTHROUGH, E3_EXECUTE, E3_EXPCOCHANGE, E3_EXPTASK, E3_EXPLAUNCH, E3_SILENT, E3_DIRECT, E3_NODELIST, E3_OCXITEM, E3_MODULEID, E3_CUSTFAV, E3_HOMEPAGE, E3_MINIMIZE, E3_UNDOCKED, E3_DOCKED, E3_PUBLICTASK, E3_LAUNCHURL, E3_BTNCHANGE, E3_STDBTNRELOAD, E3_MYBUSINESS, E3_REGLOADED, E3_LOADED, E3_V4TASK, E3_PUBMODIFY, E3_TASKRELOAD, E3_SETAUTOHIDE, E3_COCHANGE2, E3_TASK_NC, E3_V4TASK_NC, E3_TASK_ALTC, E3_V4TASK_ALTC, E3_PASSWORD, E3_LAUNCHVIEW, E3_LAUNCHBIETASK, E3_CLEANUPBIE, E3_STARTVIEW, E3_BIE_ADMIN, E3_HELPPATH, E3_CUSTOMERID, E3_MASVERSION, E3_LAUNCHEMBEDDED, E3_LAUNCHERMENU, E3_APP_POINTSIZE, E3_LAUNCHERVERSION, E3_DISABLE, E3_ENABLE, E3_SHOW, E3_HIDE, E3_REFRESH, E3_LIBMASTER, WM_COPY, wtsINITIALPROGRAM, wtsAPPLICATIONNAME, wtsWORKINGDIRECTORY, wtsOEMID, wtsSESSIONID, wtsUSERNAME, wtsWINSTATIONNAME, wtsDOMAINNAME, wtsCONNECTSTATE, wtsCLIENTBUILDNUMBER, wtsCLIENTNAME, wtsCLIENTDIRECTORY, wtsCLIENTPRODUCTID, wtsCLIENTHARDWAREID, wtsCLIENTADDRESS, wtsCLIENTDISPLAY, wtsCLIENTPROTOCOLTYPE, thmNORMAL, thmMETAL, thmOLIVE, rptREPORTTYPESTD, rptREPORTTYPELABEL, rptREPORTTYPEMULTCOL, rptISTRUE, rptISFALSE, rptISDEFAULT, rptPORTRAIT, rptLANDSCAPE, rptASCENDING, rptDESCENDING, rptRIGHTALIGN, rptLEFTALIGN, rptHORCENTERALIGN, rptLSSINGLELINE, rptSTSUM, rptSTAVERAGE, rptSTCOUNT, rptDFLTHSPACING, rptDFLTVSPACING, rptDFLTFONTSIZE, rptDFLTLEFT, rptDFLTTOP, rptTWIPSPERCHARW, rptTWIPSPERCHARH, rptSVTREPORTTITLE, rptEDTDISKFILE, rptGCANYVALUE, rptGCDAILY, rptCRDATEFIELD, rptCRDATETIMEFIELD, crEFTCrystalReport, crEFTRichText, crEFTWordForWindows, crEFTExcel, crEFTPortableDocFormat, crEFTHTML32, crEFTHTML40, crEFTExcelRecord, crEFTText, crEFTCharacterSeparatedValues, crEFTTabSeparatedText, crEFTEditableRTF, crEFTXml, crEFTRPTR, crEFTExcelWorkbook, cContextKeyLen1, cContextKeyLen2, cContextKeyLen3, adCmdText, adCmdStoredProc, adClipString, adExecuteNoRecords, adVarChar, adInteger, adParamInput, adParamOutput, adParamInputOutput, adParamReturnValue, adTextNoRecords, adOpenForwardOnly, adOpenStatic, adLockReadOnly, adUseServer, adUseClient, dbTMP$, dbTEMPDB$, dbSYSDB$, dbPVXDDF, dbPVXDB, dbMYSQL, dbADO, dbSQL, LastErrorMsg$, LastErrorNum$, SageCloudAppDesc$, IolNomads$

Methods inherited from: SY_Constant

GetNOMADSIolist$(), MaskString(), RawString(), ClassValidateEMailAddress(), dateTODAY$(), Element$(), fmtMODCODE$(), fmtMODPREFIX$(), PERFORM FunctionBreak(), GetExceptionMsg$(), GetFileName(), GetJobTitles(), GetPrinterProps(), GetRecordCount(), isALPHA(), isDATE(), isNUMERIC(), MsgPath$(), ParseString(), ParseTagField(), Position(), QUO$(), ValidateFormatType(), ZeroFill$()