This SAS `PROC SQL` code performs the following steps: 1. **Create...

September 4, 2025 at 09:16 PM

proc sql; create table def_ds as select Oblgr_Nbr from data_ds where bi_dt=next_quarter_num and Default_Ind_OblgrAbsorb=1 and Oblgr_Nbr in (select distinct Oblgr_Nbr from surv_ds); quit;

This SAS PROC SQL code performs the following steps:

  1. Create a New Table (def_ds):

    • A new table named def_ds is created.
  2. Select the Oblgr_Nbr Column:

    • It selects only the Oblgr_Nbr (Obligor Number) column from the input dataset data_ds.
  3. Apply Filtering Conditions:

    • Rows from data_ds are filtered based on the following conditions:
      • The value of bi_dt (presumably a date or time period column) must equal the value of next_quarter_num.
      • The column Default_Ind_OblgrAbsorb must be equal to 1.
      • The Oblgr_Nbr must exist in the dataset surv_ds.
  4. Subquery Usage:

    • The in clause uses a subquery that selects distinct Oblgr_Nbr values from the dataset surv_ds.
    • This ensures that only Oblgr_Nbr values common to both data_ds and surv_ds pass the filter.
  5. Output:

    • The resulting def_ds table will contain unique Oblgr_Nbr values from data_ds that satisfy all three filtering conditions.

Summary:

Essentially, this code generates a new table def_ds that contains a list of obligor numbers (Oblgr_Nbr) that:

  • Appear in the specific quarter (bi_dt = next_quarter_num),
  • Have a default indicator (Default_Ind_OblgrAbsorb = 1),
  • Exist in the reference dataset surv_ds.
Generate your own explanations
Download our vscode extension
Read other generated explanations

Built by @thebuilderjr
Sponsored by beam analytics
Read our terms and privacy policy
Forked from openai-quickstart-node