1

According to SAS not recognizing date format, 4 years and 6 months ago, MMYYSw. was unaccepted as SAS informat (but worked, and still works, as SAS format).

Nowadays, when I submit the following SAS piece of code:

DATA _NULL_;
    INPUT x :MMYYS7.; 
    CARDS;
    10/1946;
RUN;

I get "ERROR 48-59: The informat MMYYS was not found or could not be loaded".

My question is: do I get this error due to a coding error or because SAS still refuses MMYYS7. as an informat? Thanks in advance for your help.

  • 1
    FORMATs and INFORMATs are two different things. Formats convert values to text. Informats convert text to values. There is not a 1-1 correspondence between formats and informats. – Tom Feb 20 '20 at 18:41

1 Answers1

0

ANYDTDTE seems to work.

43         DATA _NULL_;
44             INPUT x :ANYDTDTE.;
45             format X mmyys.;
46             put x=date9. x=mmyys.;
47             CARDS;

x=01OCT1946 x=10/1946
data _null_
  • 8,534
  • 12
  • 14
  • If I interpret it correctly, your response is conveying two pieces of information: 1. MMYYS. still does not work as informat 2. One can use ANYDTDTE. instead. Thanks for your response! – Joel Charme Feb 20 '20 at 18:36
  • @JoelCharme Yes you have interpreted my response correctly. – data _null_ Feb 20 '20 at 22:18
  • Searching extensively through the SAS documentation about informats, I discover that, by contrast with SAS 9.4, SAS Viya does offer (https://documentation.sas.com/?docsetId=leforinforref&docsetTarget=p1hsn1ji141r4zn0z3xm2dthop6a.htm&docsetVersion=9.4&locale=en) an informat enabling to read data like 18/01 or 2018/01. I notice that this informat, YYxMM, places the 'x' (the character which separates the month and the year) between YY and MM, which makes more sense that locating it after the YY as in the SAS 9.4's format MMYYxw. – Joel Charme Feb 25 '20 at 17:30