<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: %PUT STATEMENT WONT PRINT TO LOG in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759382#M239981</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, there is a lot of stuff before for that code so it's hard to pinpoint&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*----------------------------------------------------------------
/*  ORGANIZATION
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*
/*  FIRST CREATED ON: 03/28/2018 	
/*  CREATOR:    INITIALS      
/*
/*  CODE BORROWED FROM:
/*
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*  PROJECT:           CTE 
/*                     
/*
/*  PROGRAM FUNCTION: CREATE HSAP APPLICATION FILE 
/*                    WITH CTE PROGRAM INFORMATION
/*                    CREATE ANALYSIS VARIABLES
/*                    ADD CTE COURSE DETAIL VARIABLES
/*
/*
/*  DATA IN:  /data/production/data/Master/HSAP_APPS20072018
/*			  /data/projects/CTE/Data/Master/Programs/HSPCTES2
/*		      CTEIMSDV.CTEIMSSTUMA
/*
/*  DATA OUT: /data/projects/CTE/data/Master/Students/CTE_APPLICATIONS
/*            
/*  PRECEDING PROGRAM: /data/production/student/programs/master/STUCOHHSP20072018MA
/*  FOLLOWING PROGRAM: /data/projects/CTE/Master/CTE_REP1_SAMP
/*
/*  REVISIONS
/*  PROGRAMMER	DATE	 	DESCRIPTION
/*  JJK         01/03/2019  MERGE CTE COURSE DATA 
/*  JJK         02/20/2019  MATCH WITH UPDATED HSPCTES2 FILE 
/*                          THAT INCLUDES FLAGS FOR OTHER HSAP-CTE MATCHES
/*	JJK			09/13/2019  UPDATED WITH 2017 HSAP COHORT AND FOLLOW-UP THROUGH 2017-2018
/*	JJK			02/13/2020  UPDATED WITH REVISED VERSION OF THE HSAP-CTE LINK FILE
/*                          NOTE NEW VARIABLE NAMES ON HSAP-CTE LINK FILE
/*                          NEW FILE NAME (CTE_APPLICATIONS) TO AVOID CONFUSION WITH PREVIOUS VERSION
/*  JS          06/26/2020  UPDATED CTESCHGRP TO SEPARATE DISCONTINUED HSAP-CTE FROM NEVER CTE     
/*  WHS         06/26/2020  CHANGED INPUT DATSET TO UPDATED VERSION OF HSAP_APPS20072018                 
/*	WHS			11/03/2020 	CHANGED IF STATEMENT TO CTEPOSPERMAT=2 FOR MATCHENRDAN VARIABLE
/*  WHS			11/05/2020	CREATE MACRO VARIABLE FOR NSC VARIABLES AND ADDED IT TO DUMVR ARRAY
/*  WHS			11/11/2020	CREATE MACRO VARIABLE FOR CNY VARIABLES AND ADDED IT TO DUMVR ARRAY
/*  WHS			03/05/2021  MERGE APP DATA WITH IMS (I.E. INTERNSHIP) DATA
/*	WHS			04/08/2021	UPDATED DO STATEMENT IN %CTECRS MACRO TO INCLUDE 2019 CTE-COURSE DATA
/*  WHS			05/14/2021  ADD IF STATEMENT TO CTE COURSE CREDIT VARIABLES FOR INCOMPLETE COHORTS
/*	JJK			07/20/2021	UPDATED TO INCLUDE DATA THROUGH 2020 
/*							COMMENTED OUT SUPLEMENTAL CTE COURSE DATA PENDING FURTHER DISCUSSION
/*  WHS			08/04/2021  ADDED LABEL FOR MATCHPRGM: UNMATCHED AFTER MAIN ROUND
/*
/* COMMENTS:  WE SHOULD MAKE IT CLEAR THAT MATCHPRG = MATCHPRGFIN WHEN NO MAIN ROUND MATCH
/*			  ESTIMATED RUN TIME PER HSAP_APPS SORT: 6-8 MINUTES
/*
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
%PUT LAST RUN: &amp;amp;SYSDATE;
OPTIONS NOCENTER PAGESIZE=62 LINESIZE=200 MERGENOBY=WARN ; 
OPTIONS ERRORS=50 ;
OPTIONS NOMPRINT ;
OPTIONS FMTSEARCH=(STUPROUT.STUFORMATS) ;
OPTIONS NOSYMBOLGEN NOMLOGIC;  **** Use to diagnose macro problems ;
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

LIBNAME STUPROMA  '/data/production/student/data/master';
LIBNAME STUPRORW  '/data/production/student/data/raw';
LIBNAME STUPROS1  '/data/production/student/data/step1';
LIBNAME STUPROS2  '/data/production/student/data/step2';
LIBNAME STUPROUT  '/data/production/student/util' ;
LIBNAME SCHPROS1  '/data/production/school/data/step1';

LIBNAME CTEPRGDV    '/data/projects/CTE/Data/development/CTEPRG';
LIBNAME CTESTUMA    '/data/projects/CTE/Data/Master/Students';
LIBNAME CTESTUR1    '/data/projects/CTE/Data/Report 1';
LIBNAME CTEPRGMA    '/data/projects/CTE/Data/Master/Programs';
LIBNAME CTECRSMA    '/data/projects/CTE/Data/Master/Courses';
LIBNAME CTEIMSDV  '/data/projects/CTE/Data/development/CTEIMS'  ;

LIBNAME DEVJJKCT  '/data/development/jjk/CTE' ;

TITLE1 'RESEARCH ALLIANCE FOR NEW YORK CITY SCHOOLS' ;
TITLE2 'HSAP APPLICATION FILE WITH CTE PROGRAM INFORMATION' ;

/*WHS NOTE: STUCRSCTES2 UPDATED TO 2019-2020 SCHOOL YEAR*/
%LET CTELASTYR = 2020 ; 

PROC FORMAT ;
  VALUE CTESCHTYPF
    1 = '1:CTE HS'
    2 = '2:ACADEMIC HS'
    ;
  VALUE CTEPRGCURF
    0 = '0:PHASED OUT'
    1 = '1:PERSISTED'
    2 = '2:PHASED OUT'
    ;
  VALUE CTESCHGRPF
    1 = '1:CTE HS (PERSISTING)'
    2 = '2:ACAD HS (PERSISTING)'
    3 = '3:PHASED OUT'
    9 = '9:NO CTE'
    ;
RUN;

/* PREPARE HSAP APPLICATION DATA FOR MERGING WITH HSAP-CTE PROGRAM DATA */
%PUT SORT HSAP_APPS DATA BY APPLICATION PROGRAM;
PROC SORT DATA=STUPROMA.HSAP_APPS20072018 OUT=CTE_APPS ;
  BY HSCOHG9A PROG ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Aug 2021 16:16:21 GMT</pubDate>
    <dc:creator>whs278</dc:creator>
    <dc:date>2021-08-04T16:16:21Z</dc:date>
    <item>
      <title>%PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759379#M239979</link>
      <description>&lt;P&gt;I have a program with a lot of huge sorting procedures.&amp;nbsp; I would like to print messages to the log so I can easily check on the progress of the program while it's running.&amp;nbsp; I have written something to similar to the code below but when I run it, nothing gets printed to the log even after the PROC SORT procedure is finished.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put SORT ED DATA BY KEYVAR;
proc sort data = ED_DATA;
  by KEYVAR;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Aug 2021 16:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759379#M239979</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-08-04T16:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759380#M239980</link>
      <description>&lt;P&gt;There's probably an error of some kind higher up in the code, possibly a missing semi-colon.&amp;nbsp; Can you post more of your code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your log is in color (i.e. not a batch job), you can make the %PUT statement stand out more by adding the text, "NOTE:" before it.&amp;nbsp; See example, below.&amp;nbsp; This will colorize the text to a sort of light blue which will make it easier to spot.&amp;nbsp; Probably it's not working, just as you say, but sometimes it's just hard to spot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put NOTE: SORT ED DATA BY KEYVAR;
proc sort data = ED_DATA;
  by KEYVAR;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Aug 2021 16:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759380#M239980</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-04T16:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759382#M239981</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, there is a lot of stuff before for that code so it's hard to pinpoint&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*----------------------------------------------------------------
/*  ORGANIZATION
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*
/*  FIRST CREATED ON: 03/28/2018 	
/*  CREATOR:    INITIALS      
/*
/*  CODE BORROWED FROM:
/*
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*  PROJECT:           CTE 
/*                     
/*
/*  PROGRAM FUNCTION: CREATE HSAP APPLICATION FILE 
/*                    WITH CTE PROGRAM INFORMATION
/*                    CREATE ANALYSIS VARIABLES
/*                    ADD CTE COURSE DETAIL VARIABLES
/*
/*
/*  DATA IN:  /data/production/data/Master/HSAP_APPS20072018
/*			  /data/projects/CTE/Data/Master/Programs/HSPCTES2
/*		      CTEIMSDV.CTEIMSSTUMA
/*
/*  DATA OUT: /data/projects/CTE/data/Master/Students/CTE_APPLICATIONS
/*            
/*  PRECEDING PROGRAM: /data/production/student/programs/master/STUCOHHSP20072018MA
/*  FOLLOWING PROGRAM: /data/projects/CTE/Master/CTE_REP1_SAMP
/*
/*  REVISIONS
/*  PROGRAMMER	DATE	 	DESCRIPTION
/*  JJK         01/03/2019  MERGE CTE COURSE DATA 
/*  JJK         02/20/2019  MATCH WITH UPDATED HSPCTES2 FILE 
/*                          THAT INCLUDES FLAGS FOR OTHER HSAP-CTE MATCHES
/*	JJK			09/13/2019  UPDATED WITH 2017 HSAP COHORT AND FOLLOW-UP THROUGH 2017-2018
/*	JJK			02/13/2020  UPDATED WITH REVISED VERSION OF THE HSAP-CTE LINK FILE
/*                          NOTE NEW VARIABLE NAMES ON HSAP-CTE LINK FILE
/*                          NEW FILE NAME (CTE_APPLICATIONS) TO AVOID CONFUSION WITH PREVIOUS VERSION
/*  JS          06/26/2020  UPDATED CTESCHGRP TO SEPARATE DISCONTINUED HSAP-CTE FROM NEVER CTE     
/*  WHS         06/26/2020  CHANGED INPUT DATSET TO UPDATED VERSION OF HSAP_APPS20072018                 
/*	WHS			11/03/2020 	CHANGED IF STATEMENT TO CTEPOSPERMAT=2 FOR MATCHENRDAN VARIABLE
/*  WHS			11/05/2020	CREATE MACRO VARIABLE FOR NSC VARIABLES AND ADDED IT TO DUMVR ARRAY
/*  WHS			11/11/2020	CREATE MACRO VARIABLE FOR CNY VARIABLES AND ADDED IT TO DUMVR ARRAY
/*  WHS			03/05/2021  MERGE APP DATA WITH IMS (I.E. INTERNSHIP) DATA
/*	WHS			04/08/2021	UPDATED DO STATEMENT IN %CTECRS MACRO TO INCLUDE 2019 CTE-COURSE DATA
/*  WHS			05/14/2021  ADD IF STATEMENT TO CTE COURSE CREDIT VARIABLES FOR INCOMPLETE COHORTS
/*	JJK			07/20/2021	UPDATED TO INCLUDE DATA THROUGH 2020 
/*							COMMENTED OUT SUPLEMENTAL CTE COURSE DATA PENDING FURTHER DISCUSSION
/*  WHS			08/04/2021  ADDED LABEL FOR MATCHPRGM: UNMATCHED AFTER MAIN ROUND
/*
/* COMMENTS:  WE SHOULD MAKE IT CLEAR THAT MATCHPRG = MATCHPRGFIN WHEN NO MAIN ROUND MATCH
/*			  ESTIMATED RUN TIME PER HSAP_APPS SORT: 6-8 MINUTES
/*
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
%PUT LAST RUN: &amp;amp;SYSDATE;
OPTIONS NOCENTER PAGESIZE=62 LINESIZE=200 MERGENOBY=WARN ; 
OPTIONS ERRORS=50 ;
OPTIONS NOMPRINT ;
OPTIONS FMTSEARCH=(STUPROUT.STUFORMATS) ;
OPTIONS NOSYMBOLGEN NOMLOGIC;  **** Use to diagnose macro problems ;
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/

LIBNAME STUPROMA  '/data/production/student/data/master';
LIBNAME STUPRORW  '/data/production/student/data/raw';
LIBNAME STUPROS1  '/data/production/student/data/step1';
LIBNAME STUPROS2  '/data/production/student/data/step2';
LIBNAME STUPROUT  '/data/production/student/util' ;
LIBNAME SCHPROS1  '/data/production/school/data/step1';

LIBNAME CTEPRGDV    '/data/projects/CTE/Data/development/CTEPRG';
LIBNAME CTESTUMA    '/data/projects/CTE/Data/Master/Students';
LIBNAME CTESTUR1    '/data/projects/CTE/Data/Report 1';
LIBNAME CTEPRGMA    '/data/projects/CTE/Data/Master/Programs';
LIBNAME CTECRSMA    '/data/projects/CTE/Data/Master/Courses';
LIBNAME CTEIMSDV  '/data/projects/CTE/Data/development/CTEIMS'  ;

LIBNAME DEVJJKCT  '/data/development/jjk/CTE' ;

TITLE1 'RESEARCH ALLIANCE FOR NEW YORK CITY SCHOOLS' ;
TITLE2 'HSAP APPLICATION FILE WITH CTE PROGRAM INFORMATION' ;

/*WHS NOTE: STUCRSCTES2 UPDATED TO 2019-2020 SCHOOL YEAR*/
%LET CTELASTYR = 2020 ; 

PROC FORMAT ;
  VALUE CTESCHTYPF
    1 = '1:CTE HS'
    2 = '2:ACADEMIC HS'
    ;
  VALUE CTEPRGCURF
    0 = '0:PHASED OUT'
    1 = '1:PERSISTED'
    2 = '2:PHASED OUT'
    ;
  VALUE CTESCHGRPF
    1 = '1:CTE HS (PERSISTING)'
    2 = '2:ACAD HS (PERSISTING)'
    3 = '3:PHASED OUT'
    9 = '9:NO CTE'
    ;
RUN;

/* PREPARE HSAP APPLICATION DATA FOR MERGING WITH HSAP-CTE PROGRAM DATA */
%PUT SORT HSAP_APPS DATA BY APPLICATION PROGRAM;
PROC SORT DATA=STUPROMA.HSAP_APPS20072018 OUT=CTE_APPS ;
  BY HSCOHG9A PROG ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Aug 2021 16:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759382#M239981</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-08-04T16:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759385#M239983</link>
      <description>&lt;P&gt;OK, excellent, thank you.&amp;nbsp; I don't see anything obvious that is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, can you post the log?&amp;nbsp; Please, as you are with the SAS programs (thank you!), use the below indicated icon to post the log.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1628093997687.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62248iCACCA722AC2FB141/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1628093997687.png" alt="jimbarbour_0-1628093997687.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;There should be some messages that precede the %PUT statement, something like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;DEVJJKCT assigned sucessfully&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There should also be some SAS generated statements after the Format procedure.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above normal log information is present, then we know that the log is working up to the point where the %PUT occurs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 16:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759385#M239983</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-04T16:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759395#M239987</link>
      <description>Thanks, for the quick reply.&lt;BR /&gt;&lt;BR /&gt;I just realized that it does actually print to the log after the PROC SORT is completed.  Sorry for the mistake.  &lt;BR /&gt;&lt;BR /&gt;Is there anyway to get it to print to the log before the PROC SORT procedure starts?</description>
      <pubDate>Wed, 04 Aug 2021 17:04:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759395#M239987</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-08-04T17:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759397#M239988</link>
      <description>&lt;P&gt;As long as the %PUT is before the Sort, then it is correctly placed.&amp;nbsp; SAS can be odd sometimes in terms of when it writes what to the log.&amp;nbsp; We're just going to have to play with it a bit.&amp;nbsp; We should see if you're options are set to WRITE=IMMEDIATE, which may help, and we can try moving the %PUT to inside the Proc Sort, before the BY statement.&amp;nbsp; Placement may make a difference; I don't know; I'm just trying things here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lastly, we could make the %PUT statement write multiple lines which may force SAS to write it out sooner, depending on how much SAS is buffering the log (assuming that SAS is buffering).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In order to tell whether you are operating under WRITE=IMMEDIATE or WRITE=BUFFERED, please run the following and post the log:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC  OPTIONS OPTION=LOGPARM;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 17:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759397#M239988</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-04T17:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759405#M239993</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279633"&gt;@whs278&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks, for the quick reply.&lt;BR /&gt;&lt;BR /&gt;I just realized that it does actually print to the log after the PROC SORT is completed. Sorry for the mistake. &lt;BR /&gt;&lt;BR /&gt;Is there anyway to get it to print to the log before the PROC SORT procedure starts?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It might be worth experiment with using a data _null_ step and PUT or PUTLOG there instead of the macro %put if the actual location in the log is critical. Yes the log has more text from the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   put "this is the text I want in the log";
run;&lt;/PRE&gt;
&lt;P&gt;Or maybe a dummy macro that when executed only shows the macro invocation including your text:&lt;/P&gt;
&lt;PRE&gt;%macro Message(text);
data _null_;
run;
%mend;

%Message(this is the text I want in the log);

%Message(Another bit of text to display);&lt;/PRE&gt;
&lt;P&gt;A more creative name than Message might even help readability of your log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 17:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759405#M239993</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-04T17:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759436#M240002</link>
      <description>This is what I get....&lt;BR /&gt;&lt;BR /&gt;SAS (r) Proprietary Software Release 9.4  TS1M2&lt;BR /&gt;&lt;BR /&gt; LOGPARM=WRITE=BUFFERED ROLLOVER=NONE OPEN=REPLACE&lt;BR /&gt;  specifies when SAS log files are opened, closed, and according to the LOG= system option, how they are named.&lt;BR /&gt;NOTE: PROCEDURE OPTIONS used (Total process time):&lt;BR /&gt;      real time           0.00 seconds&lt;BR /&gt;      cpu time            0.00 seconds&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can you change to WRITE=IMMEDIATE for one SAS program or does this have to be set up in the system?&lt;BR /&gt;&lt;BR /&gt;Perhaps writing a macro similar to the one ballardw suggested is my best option.&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Aug 2021 18:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759436#M240002</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-08-04T18:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759442#M240005</link>
      <description>&lt;P&gt;I cannot replicate your issue.&lt;/P&gt;
&lt;PRE&gt;2213  /* PREPARE HSAP APPLICATION DATA FOR MERGING WITH HSAP-CTE PROGRAM DATA */
2214  %PUT SORT HSAP_APPS DATA BY APPLICATION PROGRAM;
SORT HSAP_APPS DATA BY APPLICATION PROGRAM
2215  PROC SORT DATA=STUPROMA.HSAP_APPS20072018 OUT=CTE_APPS ;
ERROR: Libref STUPROMA is not assigned.
2216    BY HSCOHG9A PROG ;
2217  RUN;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.CTE_APPS may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;What version of SAS are you using?&lt;BR /&gt;How are you submitting the program? Are you using some front-end tool like Enterprise Guide or SAS/Studio? Using interactive SAS (with or without DMS)?&amp;nbsp; Submitting from command line (running in background)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 18:49:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759442#M240005</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-04T18:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759449#M240009</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279633"&gt;@whs278&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;LOGPARM=WRITE=BUFFERED ROLLOVER=NONE OPEN=REPLACE&lt;BR /&gt;&lt;BR /&gt;Can you change to WRITE=IMMEDIATE for one SAS program or does this have to be set up in the system?&lt;BR /&gt;&lt;BR /&gt;Perhaps writing a macro similar to the one ballardw suggested is my best option.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you're submitting a batch job (command line, shell script, etc), then yes.&amp;nbsp; With Display Manager (PC SAS), Enterprise Guide, and SAS Studio, generally no.&amp;nbsp; The Admin has to set that up.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the mean time, try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%PUT  NOTE-  ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Place that statement&amp;nbsp;&lt;EM&gt;after&lt;/EM&gt; your existing %PUT.&amp;nbsp; Repeat that statement five times, all after your original %PUT.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm assuming here that you have added "NOTE:" to your original %PUT.&amp;nbsp; The "NOTE: " induces colorization and makes things easier to see.&amp;nbsp; If you for some reason don't want to add "NOTE: ", then delete "NOTE- " from the SAS code I posted above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully a few "blank" %PUT statements will cause SAS to write to the log&amp;nbsp;&lt;EM&gt;before&lt;/EM&gt; the sort.&amp;nbsp; If not, we could try a macro as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;suggests.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 19:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759449#M240009</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-04T19:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759461#M240012</link>
      <description>&lt;P&gt;If my first suggestion in my most recent prior post doesn't do what you need, then try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%PUT	NOTE:  Intiating SORT of SAShelp.Cars %Get_Date %Get_Time;
%LET	Sleep_Time	=	%SYSFUNC(SLEEP(1,1));

PROC	SORT	DATA=SAShelp.Cars
				OUT	=WORK.Cars;
		BY		MPG_Highway;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm adding a SYSFUNC(SLEEP(1,1)) after the initial %PUT.&amp;nbsp; This puts the job to "sleep" (suspends execution) for 1 second (on Windows; the settings are different for UNIX or z/OS).&amp;nbsp; Hopefully, this will cause the log statements to be written in the order we want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 19:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759461#M240012</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-04T19:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759547#M240040</link>
      <description>SAS Version is 9.4 M2.&lt;BR /&gt;&lt;BR /&gt;I'm using Enterprise guide.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Aug 2021 22:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759547#M240040</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-08-04T22:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759548#M240041</link>
      <description>Unfortunately, this didn't work.</description>
      <pubDate>Wed, 04 Aug 2021 22:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759548#M240041</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-08-04T22:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759549#M240042</link>
      <description>Unfortunately, adding %put statements  after the initial statement didn't work.</description>
      <pubDate>Wed, 04 Aug 2021 22:38:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759549#M240042</guid>
      <dc:creator>whs278</dc:creator>
      <dc:date>2021-08-04T22:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759550#M240043</link>
      <description>&lt;P&gt;So, neither the %PUT or the SLEEP worked?&amp;nbsp; Yipes!&amp;nbsp; I wonder what the buffering parameters are on your system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is very unusual behavior.&amp;nbsp; M2 is a little bit old (7 years), so maybe that's it?&amp;nbsp; I've been using M4, M5, and M6 over the last several years.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe try&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;'s macro idea?&amp;nbsp; or try 25 %PUT statements. See macro, below.&amp;nbsp; This is kind of ridiculous though, just to get SAS to do what it should have been doing all along.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%MACRO	Blank_Line(Lines);
	%LOCAL	i;
	%IF	%BQUOTE(&amp;amp;Lines)	=	%BQUOTE()	%THEN
		%LET	lines	=	1;

	%DO	i				=	1	%TO		&amp;amp;Lines;
		%PUT	NOTE-  ;
	%END;
%MEND	Blank_Line;

%Blank_line(25);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 22:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759550#M240043</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-04T22:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759556#M240047</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;In this configuration of options in SAS 9.4 M7::&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1628118308947.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62279i01083D3C27CE2B3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1628118308947.png" alt="Cynthia_sas_0-1628118308947.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I find everything works as expected as shown below. With and without NOTE in the %PUT:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_1-1628118550352.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62280iAE6909317A91195D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_1-1628118550352.png" alt="Cynthia_sas_1-1628118550352.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Tech Support can test on older versions of SAS and probably on the same operating system. What you see is odd behavior, I can't explain it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 23:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759556#M240047</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-08-04T23:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759561#M240050</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279633"&gt;@whs278&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you try it at least once with NOTE:&amp;nbsp; (case sensitive, must be upper case) as part of your %PUT.&amp;nbsp; I've seen SAS handle %PUT with and without NOTE: differently.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 23:33:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759561#M240050</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-04T23:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: %PUT STATEMENT WONT PRINT TO LOG</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759563#M240052</link>
      <description>&lt;P&gt;Try this in a new SAS session:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%PUT	NOTE:  Initiating SORT of SAShelp.Cars;

PROC	SORT	DATA=SAShelp.Cars
				OUT	=WORK.Cars;
		BY		MPG_Highway;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is my SAS log using SAS9.4 M2 and EG 8.3:&lt;/P&gt;
&lt;PRE&gt;1          %_eg_hidenotesandsource;
5          %_eg_hidenotesandsource;
33         
34         %PUT	NOTE:  Initiating SORT of SAShelp.Cars;
NOTE:  Initiating SORT of SAShelp.Cars
35         
36         PROC	SORT	DATA=SAShelp.Cars
37         				OUT	=WORK.Cars;
38         		BY		MPG_Highway;
39         RUN;

NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: The data set WORK.CARS has 428 observations and 15 variables.
NOTE: Compressing data set WORK.CARS decreased size by 0.00 percent. 
      Compressed is 2 pages; un-compressed would require 2 pages.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds
      

40         
41         %_eg_hidenotesandsource;
55         
56         
57         %_eg_hidenotesandsource;
60         &lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Aug 2021 23:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUT-STATEMENT-WONT-PRINT-TO-LOG/m-p/759563#M240052</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-08-04T23:40:43Z</dc:date>
    </item>
  </channel>
</rss>

