BookmarkSubscribeRSS Feed
Rixile106
Fluorite | Level 6

Good day Expects.

 

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

 

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

 

and I am getting error as below:

 

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

PROC SQL;
	CREATE TABLE INSTA_A AS
		SELECT INPUT(PUT(COMPRESS(INPUT(PUT(ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) AS ACCOUNT
			,A_COMM_DT AS COMM_DT
			,A_EXP_DT AS EXP_DT
			,'A' AS INSTRUCTION
		FROM VBM.INST_A
		WHERE INPUT(PUT(A_COMM_DT,Z8.),DATEZ8.) > TODAY() + 365

		;
QUIT;

 

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

 

Please help.

9 REPLIES 9
PaigeMiller
Diamond | Level 26

No such informat exists in SAS, as you can see at this link. So you can't use it.

Alphabetical list of all SAS informats

 

Please tell us what you are trying to do. What do you want this informat to do? Please give an example.

--
Paige Miller
Rixile106
Fluorite | Level 6
i am trying to change the format of the date field from YYMMDD88 to dateZ8
PaigeMiller
Diamond | Level 26

But there's no such things as DATEZ8, so I don't know what you mean.

 

Show us the value in the date field, and show us the desired appearance once you format it.

--
Paige Miller
PaigeMiller
Diamond | Level 26

No such informat exists in SAS, as you can see at this link. So you can't use it.

Alphabetical list of all SAS informats

 

Please tell us what you are trying to do.

--
Paige Miller
ballardw
Super User

Show a value of 1) what PUT(A_COMM_DT,Z8.) will look like for one or more values

                           2) show what the expected DATE that is generated from that should be in basic words, do not apply "datez." just show us the words like 4 July 2022.

 

 

I would say that roughly 80% of the cases where I see Input (put(somevariable) , formats) related to created dates, times or datetimes involve someone that does not know just how many SAS date related informats there are and typically are abusing one that they learned without someone explaining there are several dozen informats available. And possibly that a function like MDY might be more appropriate.

SASKiwi
PROC Star

You have another problem here:

SELECT INPUT(PUT(COMPRESS(INPUT(PUT(ACC_NO,13.),$13.)||PUT(SERIAL_NO,Z3.)),$16.),16.) AS ACCOUNT

You are trying to convert a 16 character string into a numeric. SAS can't store 16 digit numbers accurately and there is no need to convert to a number in the first place - leave account as character:

SELECT COMPRESS(PUT(ACC_NO,13.))||PUT(SERIAL_NO,Z3.) AS ACCOUNT
Tom
Super User Tom
Super User

What types of numbers do you have have in the variable A_COMM_DT?

Are they numbers like 20,221,013  ? If so then use the YYMMDD8. informat.

Or numbers like 13,102,022 ? If so then use the DDMMYY8. informat.

Or number like 10,132,022 ? Is do the use the MMDDYY8. informat.

Something else?  Then show some of the values and explain what date you think they represent.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 9 replies
  • 781 views
  • 0 likes
  • 6 in conversation