DATA Step, Macro, Functions and more

ERROR: The informat YYMMDDN8 was not found or could not be loaded.

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

ERROR: The informat YYMMDDN8 was not found or could not be loaded.

Dear Mentors,

 

I am running a piece of code vis shell script through putty which uses the below line:

 

INPUT(PUT(DATEPART(A1.Date), YYMMDD8.), YYMMDDN8.)

 

and I am getting error as below:

 

ERROR: The informat YYMMDDN was not found or could not be loaded.

 

However, when i ran the same code in SAS Studio, it runs smoothly.

 

Please help.

 

Thanks in Advance.

 

Sandeep


Accepted Solutions
Solution
2 weeks ago
Super User
Posts: 3,768

Re: ERROR: The informat YYMMDDN8 was not found or could not be loaded.

Posted in reply to samgautam007

The PUT and INPUT functions appear to be redundant as DATEPART creates a SAS data to start with. Try this:

 

DATEPART(A1.Date) format = YYMMDD8.

View solution in original post


All Replies
PROC Star
Posts: 2,226

Re: ERROR: The informat YYMMDDN8 was not found or could not be loaded.

[ Edited ]
Posted in reply to samgautam007

There is not YYMMDDN informat supplied by SAS.

Maybe is it a user-created informat that is available in one environment..

Either way just remove the n and your code should run fine.

 

Solution
2 weeks ago
Super User
Posts: 3,768

Re: ERROR: The informat YYMMDDN8 was not found or could not be loaded.

Posted in reply to samgautam007

The PUT and INPUT functions appear to be redundant as DATEPART creates a SAS data to start with. Try this:

 

DATEPART(A1.Date) format = YYMMDD8.
PROC Star
Posts: 2,226

Re: ERROR: The informat YYMMDDN8 was not found or could not be loaded.

@SASKiwi lol you are right. Time to go home! 

Super User
Posts: 3,768

Re: ERROR: The informat YYMMDDN8 was not found or could not be loaded.

@ChrisNZ - too right. I'm out the door too!

Occasional Contributor
Posts: 5

Re: ERROR: The informat YYMMDDN8 was not found or could not be loaded.

[ Edited ]
Posted in reply to samgautam007

Thanks @ChrisNZ and @SASKiwi for your inputs.

 

I have executed below command:

 

data a;
z=input(put(today(),yymmddn8.),yymmddn8.);
run;

data b;
z=input(put(today(),yymmddn8.),yymmdd8.);
run;

proc sql;
create table c as
select *,input(put(today(),yymmddn8.),yymmddn8.) as v from a
;quit;

 

And I am surprised why Proc sql is not throwing error.

 

Your help is much appreciated.

 

Super User
Posts: 9,574

Re: ERROR: The informat YYMMDDN8 was not found or could not be loaded.

Posted in reply to samgautam007
  • there is no informat yymmddn8. in default SAS, period.
  • your code is equivalent to
data a;
z=today();
run;

data b;
z=today();
run;

proc sql;
create table c as
select *, today() as v from a
;
quit;

The whole put/input thing makes no sense, as it does not change values in any way.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 141 views
  • 4 likes
  • 4 in conversation