COMPILE ROUTINE TEST_OBJ_EXPORT(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Notes, Set_Status, obj_Export, ErrMsg
DECLARE FUNCTION Get_Status, Utility, obj_Export

$INSERT COC_EQU

EQU CRLF$ TO \0D0A\

debug

ColNos = '1':@VM:'4':@VM:'56':@VM:'86':@VM:'87'

eXcelCols = obj_Export('ExcelCol',ColNos)

DEBUG

GOTO Bail







EQU EXPORTS_COLUMNS$			TO 1
EQU EXPORTS_QUERY_COLUMNS$		TO 2
EQU EXPORTS_QUERY_COL_FILTER$	TO 3
EQU EXPORTS_PATH$				TO 4
EQU EXPORTS_TABLE$				TO 5
EQU EXPORTS_DESCRIPTION$		TO 6
EQU EXPORTS_ENTRY_ID$			TO 7
EQU EXPORTS_ENTRY_DATE$			TO 8
EQU EXPORTS_SHARABLE$			TO 9
EQU EXPORTS_NQUERY_COLUMNS$		TO 10
EQU EXPORTS_NQUERY_COL_FILTER$	TO 11
EQU EXPORTS_UTIL_START$			TO 12
EQU EXPORTS_UTIL_END$			TO 13
EQU EXPORTS_EXPAND_MV$			TO 14

*TypeOver = ''
*TypeOver<EXPORTS_QUERY_COL_FILTER$> = 'FROM 12/16/07 TO 12/24/07'

*obj_Export('ExportTemplate','PC_INV':@RM:'')

Set_Status(0)
ShipNos = '91420'
FOR I = 1 TO COUNT(ShipNos,@VM) + (ShipNos NE '')

	ShipNo = ShipNos<1,I>

	ShipRec = XLATE('COC',ShipNo,'','X')
	
	
	KeyList = ShipRec<COC_RDS_NO$>

	DosTable = 'C:\OIReports\W':ShipNo:'.TSV'
	NoHeader = ''
			
	ExportID = 'WALES_SYSTEM_RDS_DATA'	
	
	
	obj_Export('ExportDelimited','Comma':@RM:KeyList:@RM:ExportID:@RM:DosTable:@RM:@RM:@RM:NoHeader)
	

	* This is the ftp code here
		
	ToWalesScript  = 'open nptftp.irf.com':CRLF$
	ToWalesScript := 'user':CRLF$
	ToWalesScript := 'irep':CRLF$
	ToWalesScript := 'g6fyi9':CRLF$
	ToWalesScript := 'lcd \':CRLF$
	ToWalesScript := 'put ':DosTable:CRLF$
	ToWalesScript := 'bye':CRLF$

	OSWrite ToWalesScript ON 'c:\OIReports\ToWales.scr'
/*
	stat = UTILITY('RUNWIN',"ftp -i -n -s:c:\OIReports\ToWales.scr")
	IF Get_Status(errCode) THEN 
		ErrMsg(errCode)
	END ELSE
		OSDelete DosTable		;* Removes *.tsv table from C: drive 
	END
	*/
NEXT I



* * * * * * *
Bail:
* * * * * * *

RETURN
