Project

General

Profile

Actions

Support #2268

open

Code Creator temp file

Added by Ziran Wei about 1 month ago. Updated 19 days ago.

Status:
Feedback
Priority:
Normal
Category:
Code Creator
Start date:
08/03/2025
% Done:

70%


Description

Dear Understanding Society support team,

I am Ziran Wei, and I am quite new to this dataset. I am using the Code Creator to select some variables to do a trial run for my research (namely diabetestypn hcond14 hcondn14 hconds14 jspayu). The problem, however, is when I run the code given (the filepath of course modified), Stata appears to show file temp_a.dta not found. I wonder what I have done wrong and how to make it work.

Best regards.


Files

2268.do (8.03 KB) 2268.do Understanding Society User Support Team, 08/04/2025 05:10 PM
1.PNG (10.1 KB) 1.PNG Ziran Wei, 08/04/2025 06:15 PM
Actions #1

Updated by Understanding Society User Support Team about 1 month ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 70
  • Private changed from Yes to No

Hello,

The file you're looking for, temp_a.dta, is automatically deleted in the last loop in the code (around line 170). If you don't change anything in the code except the paths at the beginning, the outcome file will be named UKHLS_wide_hij.dta (here for the wide format). Let us know if this explains the issue.

Best wishes,
UKHLS User Support

Actions #2

Updated by Ziran Wei about 1 month ago

Hi UKHLS User Support

My problem is that the temp file was never created from the first place I believe, the warning of temp_a.dta not found is first seen here:

use pidp `firstvar' using "temp_`firstWave'", clear
file temp_a.dta not found

rather in the last loop.

Best Regards,
Ziran

Actions #3

Updated by Understanding Society User Support Team about 1 month ago

Hi Ziran,

I get the code in the attached file when I try your combination of variables. It works for us, can you check it works for you?

Best wishes,
UKHLS User Support

Actions #4

Updated by Ziran Wei about 1 month ago

Hi,UKHLS User Support

The same problem appears it seems.
I am really confused right now.

Best regards,
Ziran

Actions #5

Updated by Ziran Wei about 1 month ago

Dear UKHLS User Support

I am adding this screenshot to show where I think the problem is.

Best Regards,
Ziran

Actions #6

Updated by Understanding Society User Support Team about 1 month ago

Hello Ziran,

Just to double-check, are you running the syntax as a do-file?
From the screenshot you sent, it looks like you might be running it directly in the command window. Is that correct?

Best wishes,
UKHLS User Support

Actions #7

Updated by Ziran Wei 20 days ago

Yes! Sorry I was a bit new to this. Thank you so much!

Actions #8

Updated by Understanding Society User Support Team 19 days ago

Hi Ziran,

Have you now run the code as a dofile and not from the command window, and has that solved the problem?

Thanks,
Understanding Society User Support Team

Actions

Also available in: Atom PDF