Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

def main ( ) : # Prompt for input values sdf _ file = input ( Enter the path to the SDF file:

def main():
# Prompt for input values
sdf_file = input("Enter the path to the SDF file: ")
ems_file = input("Enter the path to the EMS file: ")
pp_end_date1= input("Enter the first PP end date (YYYY-MM-DD): ")
pp_end_date2= input("Enter the second PP end date (YYYY-MM-DD): ")
pp_end_dates =[pp_end_date1, pp_end_date2]
# Read SSN to EID mapping
ssn_eid_map = read_ssn_eid_mapping(ems_file)
# Process the SDF file
pp_data, bw_data = process_sdf(sdf_file, ssn_eid_map, pp_end_dates)
# Create output folder
output_folder = f"Outputfolder_{datetime.now().strftime('%Y-%m-%d')}"
os.makedirs(output_folder, exist_ok=True)
# Write output files
pp_file_name = os.path.join(output_folder, "PER-PERF-EMPLOYEES.csv")
bw_file_name = os.path.join(output_folder, "REGULAR-EMPLOYEES.csv")
write_csv(pp_file_name, pp_data)
write_csv(bw_file_name, bw_data)
print(f"Files saved in folder: {output_folder}")
if __name__=="__main__":
main()
Results:
Enter the path to the SDF file: F:\SDF_Translation\DP611.SDF
Enter the path to the EMS file: F:\SDF_Translation\Dept611EMS\EMS_Person_Number_To_Last5.csv
Enter the first PP end date (YYYY-MM-DD): 2024-05-25
Enter the second PP end date (YYYY-MM-DD): 2024-06-01
Files saved in folder: Outputfolder_2024-06-09
Now, we need to prompt user of where to save the folder along with its two created files. As you can see this def main() function works just don't know where it saving the folder and files.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions

Question

How does array differ from the built-in array?

Answered: 1 week ago

Question

denigration of emotional outbursts; being reserved;

Answered: 1 week ago