data AMBSA_STATIC(drop=flag tmp point tmp2 _rowcnt); infile "&G_IFC_RAW_PENDING_PATH./ambsa.static.txt" RECEM+N; RETAIN flag 0; If flag=0 then 0; input tmp $EBCDIC87. @@; point=index(tmp, '#BEGIN'); if point then do; call cynput("header_ind",'Y'); header=substr(tmp,1,86); point =point+86; flag=1; input @point r_dte $EBCDIC10. @@; link readdata; end; end; else do; input r_dte $EBCDIC10. @@; link readdata; end; if flag=1; return: readdata: if substr(r_dte,1,4) ne '#END' or substr(r_Dte,1,1)ne '#' THEN DO; input r_type $EBCDIC1. ABMS_ORG $EBCDIC3. . . AMBS_USER_AMT S370FPD9.0 . . . AMBS_LOAN_TRF_IND $EBCDIC1 @@; END; ELSE DO; input tmp2 $EBCDIC76.; CALL SYMPUT("trailer_ind",'y'); trailer=r_dte || tmp2 _rowcnt=sub(trailer,70,9); FILE log; IF input(_rowcnt,9)=_n_-1 then do; PUT_rowcnt _n_; put "correct_Row_number"; . . .
my question is "is it possible to tell if r_dte is created newly in this program or it comes from input dataset RAW_PENDING_PATH.
@HeatherNewton wrote:my question is "is it possible to tell if r_dte is created newly in this program or it comes from input dataset RAW_PENDING_PATH.
Yes:
Option 3: read the log. A message about uninitialized variables positively tells you it's not in an incoming dataset.
I don't see any statement in your code, that processes a dataset at all, so all variables are created in the step you have posted.
Can you attempt again to explain what your question is? The current question does not appear to have anything to do with the example code posted. The posted code is not using any existing DATASET. It is reading from a TEXT FILE.
Are you asking if the data step is reading the value of the variable from the contents of the text file?
Then yes there are two different INPUT statement that are setting the value of r_dte by reading characters from the text file.
input @point r_dte $EBCDIC10. @@;
...
input r_dte $EBCDIC10. @@;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.