I suggest you start reading the SAS documentation, because your code has so many errors resulting from missing knowledge.
data INFLE2;
infile DD01;
input
@36 YearX 4.
@1 Record $char150.;
if YearX = year(today());
run;
show us some code 🙂
Show us some code and show us some test data data in the form of a datastep.
E.g.:
data have; input year; datalines; 2013 2017 ; run;
Something like this?
data years;
input year;
datalines;
2013
2014
2015
2016
2017
;
run;
proc print data=years; where year=year(today()); run;
Input file is of 150.. Year is starting at 36th.. A0214494 FLDNIW0000414600DRIN 201401010.... A0214494 FLDNIW0000104200CRIN 201401010.. A0330094 FLDQIW0000104200CRSD 201401010.. SAS code: DATA INFLE1; DATERUN = TODAY(); FINAL_YEAR=YEAR(DATERUN); FORMAT FINAL_YEAR YEAR4. ; RUN ; PROC PRINT DATA=INFLE1; DATA INFLE2; INFILE DD01; INPUT @36 YEARX 4. @1 RECORD $CHAR150.; FORMAT YEARX YEAR4.; RUN; PROC PRINT DATA=INFLE2; DATA OUTP1; SET INFLE1 INFLE2; IF YEARX = FINAL_YEAR THEN OUTPUT OUTP1 ; RUN; DATA FINAL1; SET OUTP1 ; FILE DD01O; PUT @1 RECORD $CHAR150.; RUN;
YEARX = FINAL_YEAR is not working ... i have tried other formatting options too... like took input year in Char as well.. but 0 records in output..
I think issue is ..sas 's internal format.. 2017 would mean..1965 when i am moving it into YEAR4....
I suggest you start reading the SAS documentation, because your code has so many errors resulting from missing knowledge.
data INFLE2;
infile DD01;
input
@36 YearX 4.
@1 Record $char150.;
if YearX = year(today());
run;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.