DATA Step, Macro, Functions and more

Month format

Reply
Contributor
Posts: 21

Month format

Please let me know how to change this. Thank you.

 

44 MonthName = put(month,$MonMMM.);
_________
484
ERROR: File LIBRARY.FORMATS.CATALOG was created for a different operating system.
ERROR: File USERFMT.FORMATS.CATALOG was created for a different operating system.
NOTE 484-185: Format $MonMMM. was not found or could not be loaded.

PROC Star
Posts: 1,769

Re: Month format

Are you looking for 

 monname5.;

format?

 

 MonthName = put(month,monname5..);

Super User
Posts: 10,209

Re: Month format

You have two format catalogs in your fmtsearch path that were created on another platform, but catalogs are version- and platform-specific, so they can't be used, causing the ERROR messages. Get the code that was originally used to create the custom formats in there, remove those catalogs, and recreate them from code.

Alternatively, run (or have run) proc format with cntlout= on the original platform, transfer the resulting dataset(s) to your new platform, and use them as cntlin= in a proc format.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 21

Re: Month format

[ Edited ]
Posted in reply to KurtBremser

converting SAS EG 5.1 code on SAS EG 7.1

OPTIONS FMTSEARCH=(userfmt);
31 libname userfmt "/ced_d/shared2/qcpap72ydir/sas_userfmt";
NOTE: Libref USERFMT was successfully assigned as follows:
Engine: V9
Physical Name: /ced_d/shared2/qcpap72ydir/sas_userfmt
32
33 %put &Run_Date;
030618
34 data _null_;
35 header = 'clinipoint_CD_and_RD';
36
37 run_date = "&Run_Date";
38 substr(run_date,3,2) = '01';
39
40 month = substr(run_date,1,2);
41 day = substr(run_date,3,2);
42 year=substr(run_date,5,4);
43
44 MonthName = put(month,$monthMMM.);
__________
484
ERROR: File LIBRARY.FORMATS.CATALOG was created for a different operating system.
ERROR: File USERFMT.FORMATS.CATALOG was created for a different operating system.
NOTE 484-185: Format $MONTHMMM was not found or could not be loaded.

45 report_month = compress(MonthName || '_' || Year);
46
2 The SAS System 17:40 Tuesday, March 6, 2018

47 put MonthName;
48 put Year;
49 put report_month=;
50
51 call symputx('header',header,'g');
52 call symputx('report_month',report_month,'g');
53 run;

Ask a Question
Discussion stats
  • 3 replies
  • 137 views
  • 2 likes
  • 3 in conversation