Posts

l1

-- Assuming [ACCOUNT_MPL.SNAPSHOT_MONTH] is a date column representing the snapshot month -- Fetching the CAL_YR_TO_DT_PRIN_PAID_AMT for the immediately preceding snapshot month SELECT     A1.APPL_NUM,     A1.CAL_YR_TO_DT_PRIN_PAID_AMT AS last_mth_prin_paid FROM     ACCOUNT_MPL A1 JOIN     ACCOUNT_MPL A2 ON A1.APPL_NUM = A2.APPL_NUM WHERE     A1.SNAPSHOT_MONTH = DATEADD(MONTH, -1, CURRENT_DATE) -- Current snapshot month     AND A2.SNAPSHOT_MONTH = DATEADD(MONTH, -2, CURRENT_DATE); -- Immediately preceding snapshot month

Delta

 -- Sample monthly delta extract of ACCOUNT_MPL data  -- from EDH2.0 TARGET data source for mortgage performance. -- Subquery to extract Target accounts -- for the current snapshot period. with target_extract as (     select distinct         -- Key elements         am.mortgage_num                  -- Base extract filter elements.         -- Include here for debugging even if they         -- are not needed to populate the RLOB entity.        ,current_principal_bal        ,effective_date_of_discharge_org        ,line_of_credit_bal        ,mortgage_product          ,am.proc_dt_drvd        ,servicing_status        ,sub_product1                 -- Remaining ...

insertintomain

 #!/bin/sh #Keep 7days data into main table and drop older partition. set -x if [ $# -ne 2 ]; then   echo 'Invalid number of arguments --  <1.ENV> <2.Load_type>'  exit 2 else   echo Argument passed correctly. Script Now Running for Environment: $1 fi DIRNAME=`dirname $0` PWD=`pwd` echo PWD is $PWD echo DIRNAME is $DIRNAME if [ "$DIRNAME" = "." ]; then    export SCRIPT=$PWD ; else    export SCRIPT=$DIRNAME ; fi hive_table_name=creb_timer_full echo hive table name is : $hive_table_name script_edh=${SCRIPT%/*} echo script path is : $script_edh DB_DIR=${script_edh%/*} echo DB_DIR is :  $DB_DIR db=${DB_DIR##*/} echo database is :$db z2db=edh_50060_PSH_rb_$1 echo z2 db is : $z2db echo Selecting First three bytes of argument to match environment name... ENV=`echo $1 | cut -c 1-3` case "$ENV" in          "sit") export  connect_string="!connect jdbc:hive2://edh2dev.cloud1.cibc.com:10005/;principal=hive/_H...

mod

 import shutil import os # Function to move files from source to destination def move_files(source_folder, destination_folder):     # Ensure the source folder exists     if not os.path.exists(source_folder):         print("Source folder '%s' does not exist." % source_folder)         return     # Ensure the destination folder exists; create it if not     if not os.path.exists(destination_folder):         os.makedirs(destination_folder)     # Get a list of all files in the source folder     files = os.listdir(source_folder)     # Loop through the files and move them to the destination folder     for file in files:         source_path = os.path.join(source_folder, file)         destination_path = os.path.join(destination_folder, file)         # Use shutil.move to move the file   ...

new

 import shutil import os # Function to move files from source to destination def move_files(source_folder, destination_folder):     # Ensure the source folder exists     if not os.path.exists(source_folder):         print(f"Source folder '{source_folder}' does not exist.")         return     # Ensure the destination folder exists; create it if not     if not os.path.exists(destination_folder):         os.makedirs(destination_folder)     # Get a list of all files in the source folder     files = os.listdir(source_folder)     # Loop through the files and move them to the destination folder     for file in files:         source_path = os.path.join(source_folder, file)         destination_path = os.path.join(destination_folder, file)         # Use shutil.move to move the file    ...

Python file copier

 import shutil import os #Get source and destination folder paths from user input source folder = input("Enter the source folder path: ") destination folder = input("Enter the destination folder path: ") # Check if the destination folder exists, and create it if it doesn't if not os.path.exists(destination_folder): os.makedirs(destination_folder) #Get a list of files in the source folder files = os.listdir(source_folder) #Iterate through the files and copy them to the destination folder for file in files: source_file_path = os.path.join(source_folder, file) destination_file_path = os.path.join(destination_folder, file) #Check if the file is a regular file (not a directory) if os.path.isfile(source_file_path): Copy the file to the destination folder shutil.copy(source file path, destination_file_path) print('Copiad: (source file path) to (destination_file_path)') print("Files copied successfully.')
python program to print unlimited messages: import pyautogui as p import time time.sleep(10) for i in range(300):     p.typewrite("~~~~~~~~")     p.press("enter")