BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8
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.

5 REPLIES 5
PaigeMiller
Diamond | Level 26

@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:

  1. you can look at the code; or
  2. you can look at the variables in RAW_PENDING_PATH via PROC CONTENTS or other means.
--
Paige Miller
andreas_lds
Jade | Level 19

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.

Sajid01
Meteorite | Level 14
The variable r_dte does not come from RAW_PEBDING_PATH. It is indeed created newly by the code.
Tom
Super User Tom
Super User

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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 482 views
  • 2 likes
  • 6 in conversation