BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Arjayita
Obsidian | Level 7
Proc SQL noprint;
Select &RWA./sum(EAD_Current)
into :RWA_of_Exp
from Out.Live_Pre_PMA_UTD_RWA_&month.
;
Quit;
1 ACCEPTED SOLUTION

Accepted Solutions
Amir
PROC Star

Hi,

 

Thanks for posting the code using the "</>" icon, FYI, the log can also also be posted using the same icon.

 

I know you said "The authorisation level error did not create any material impact on the output/result after running the code", but the log does say:

 

ERROR: User does not have appropriate authorization level for library
OUT.

followed by:

 

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax
of statements.

and

 

NOTE: The SAS System stopped processing this step because of errors.

This means that into :RWA was not executed, so the macro variable RWA was not created, which caused the later issue:

 

WARNING: Apparent symbolic reference RWA not resolved.

Ending up with your final error (that you previously posted):

 

ERROR 22-322: Syntax error, expecting one of the following: a name, *.

 

So maybe you are seeing a previous version of the table in the out library which is why you thought you could ignore the authorisation error(?)

 

If you can, then try creating the table in a library you do have write access to and then read from that library for further processing to see if that resolves the issue.

 

Please ask if anything is unclear.

 

 

Thanks & kind regards,

Amir.

View solution in original post

11 REPLIES 11
Amir
PROC Star

Hi,

 

Thanks for sharing the code. Would you please also share the messages from the log.

 

 

Thanks & kind regards,

Amir.

Arjayita
Obsidian | Level 7

syntax error, expecting one of the following: a name, *.

Amir
PROC Star

Hi,

 

Please check and respond to the following:

 

  1. What value does the macro variable RWA have?
  2. Are you sure there is a column on Out.Live_Pre_PMA_UTD_RWA_&month named EAD_Current?
  3. Also is EAD_Current a numeric variable or is it a character variable holding a numeric value? You can use proc contents to confirm.

 

Try using the following statement before running the code again:

 

options symbolgen;

 

That should show the macro variable values in the log.

Please then copy and post the log lines showing the code and all messages using the Insert Code icon "</>" when replying to preserve formatting.

 

 

Thanks & kind regards,

Amir.

 

Edit: Typo.

Arjayita
Obsidian | Level 7

Thanks for your time. I am very new to SAS and I will give it a try tomorrow or may be share details with you. Really appreciate your response

Arjayita
Obsidian | Level 7

I have noticed that the previous programme where all these datasets have been created, got an error due to datasets being archived. After unarchiving them i will first try to run the previous programme. and even after that if i get the same error, will give you a nudge. since I have very limited idea in SAS, i thought syntax error is only to deal with ',' '/' '""' etc. Stupid me. anyway, thanks once again.

Arjayita
Obsidian | Level 7
TITLE "Live Pre PMA UTD RWA";
Proc sql;
	create table LIVE_UTD_RWA_&run.  as
		select	 RMS_Band
				,Case 	When RMS_Band = . then 0.1
						When RMS_Band = 1 then 0.00077
						When RMS_Band = 2 then 0.003675
						When RMS_Band = 3 then 0.00735
						When RMS_Band = 4 then 0.01605
						When RMS_Band = 5 then 0.0321
						When RMS_Band = 6 then 0.062895
						When RMS_Band = 7 then 0.1050
						When RMS_Band = 8 then 0.2100
						When RMS_Band = 9 then 0.3675
						else RMS_MID_PD end as PMA_PD
			    ,count(*) as obs
		   		,sum(capital_balance) as EAD_Current
		  		,sum(RWA_CAR) as V400_RWA
		  		,sum(Expected_Loss_CAR) as EL
		  		,sum(lgd_value) as LGD
	from OUT.Calibration_Data_&qmrf_report._BAU
	where basel_delinquency_category = 'A'
	group by 1,2
	;
	create table OUT.Live_Pre_PMA_UTD_RWA_&MONTH.  as
		select	 PMA_PD
			    ,sum(obs) as Obs
		   		,sum(EAD_Current) as EAD_Current
		  		,sum(LGD)/sum(EAD_Current) as LGD_PCT
				,0.03*(1-EXP(-35* pma_pd))/(1-EXP(-35))+0.16*(1-(1-EXP(-35* pma_pd))/(1-EXP(-35))) as Correlation
				,(0.11852-0.05478*log(pma_pd))**2 as Maturity
				,(calculated LGD_PCT*PROBNORM((1/SQRT(1-calculated Correlation))*PROBIT(pma_pd)+SQRT(calculated Correlation/(1-calculated Correlation))*PROBIT(0.999))- pma_pd * calculated LGD_PCT)*(1/(1-1.5*calculated Maturity))*(1+(1-2.5)*calculated Maturity) as Cap_Req_Live
				,calculated Cap_Req_Live*12.5*1.06*calculated EAD_Current as Live_RWA
	from LIVE_UTD_RWA_&run.
	group by 1
	;
	Select Sum(Live_RWA) as Live_UTD_RWA format=NLMNLGBP. length=20
	into :RWA
	From OUT.Live_Pre_PMA_UTD_RWA_&MONTH.
	;
Quit;

Proc SQL noprint;
    select &RWA./sum(EAD_Current)
    into :RWA_of_Exp
    from OUT.Live_Pre_PMA_UTD_RWA_&MONTH.
;
QUIT;
%Put RWA_of_Exp=&RWA_of_Exp. ;
TITLE;

 Hey this is me again. I tried to follow your suggestion but failed. Thats why pasted the whole code. I have attached the error message as well. The authorisation level error did not create any material impact on the output/result after running the code. Just thought of highlighting this. 

Amir
PROC Star

Hi,

 

Thanks for posting the code using the "</>" icon, FYI, the log can also also be posted using the same icon.

 

I know you said "The authorisation level error did not create any material impact on the output/result after running the code", but the log does say:

 

ERROR: User does not have appropriate authorization level for library
OUT.

followed by:

 

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax
of statements.

and

 

NOTE: The SAS System stopped processing this step because of errors.

This means that into :RWA was not executed, so the macro variable RWA was not created, which caused the later issue:

 

WARNING: Apparent symbolic reference RWA not resolved.

Ending up with your final error (that you previously posted):

 

ERROR 22-322: Syntax error, expecting one of the following: a name, *.

 

So maybe you are seeing a previous version of the table in the out library which is why you thought you could ignore the authorisation error(?)

 

If you can, then try creating the table in a library you do have write access to and then read from that library for further processing to see if that resolves the issue.

 

Please ask if anything is unclear.

 

 

Thanks & kind regards,

Amir.

Arjayita
Obsidian | Level 7

Thanks Amir for being my saviour. For some programmes this error message didn't have any impact, that is why I thought in this programme as well, this error message is not a problem. But as you explained, it clearly makes sense that one error created another error and so on. Thanks very much really appreciate your help and time. :))

ballardw
Super User

Note related to your error but the likely usage of the attempted macro variable RWA_of_Exp.

You are doing division (apparently) and placing the result which will be text into a macro variable (when it works). You are relying on SAS to convert the numeric value of the division into text that will be usable.

Without knowing the range of your values it maybe that the likely default format SAS will use may not be appropriate for your usage. Either too many digits or not enough. You may want to consider controlling what the actual value is by rounding.

Arjayita
Obsidian | Level 7

The previous programme to this, got an error because some datasets were archived. I will unarchive them and try to run the previous programme. Even after that if I get the same error, will give you nudge. many thanks :)))

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 11 replies
  • 5413 views
  • 1 like
  • 4 in conversation