REM ---------------------------------------------------------
REM About Author of this Script
REM Ronney Rajapathirana
REM Created for BCD Travels
REM Project : eTours Automation Project
REM ---------------------------------------------------------

REM ---------------------------------------------------------
REM Setting up the Environmental Variables
REM ---------------------------------------------------------

set feedback off
set echo off
set verify off

set pagesize 50000;
set pages 0;
SET LINESIZE 20000;

set term off;
set heading off;
set headsep off;

set termout off;

set trimspool on;
set wrap off;
SET SQLBLANKLINES Off;


REM ---------------------------------------------------------
REM Configuring the Spool File Name with Date and Time Stamp
REM ---------------------------------------------------------

	col sysdt noprint new_value sysdt;
   	SELECT TO_CHAR(SYSDATE, 'ddmmyyyy_hh24miss') sysdt FROM DUAL;



	spool Z:\Staff-Files\Ronney\27Million_Unbilled_Status_&sysdt..csv;

COLUMN TBSVD_FOREIGN_AMOUNT FORMAT 99,999,999.99
COLUMN TBSVD_LOCAL_AMOUNT FORMAT 99,999,999.99

select * from ke074t3_support.bcd_ict_all_booking_view_a where sv_no in (select svnumber from SAFCOM_UNBILLED_27MIL)


spool off;


REM ---------------------------------------------------------
REM Data File Has been Created
REM ---------------------------------------------------------

quit;