BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kk21
Fluorite | Level 6

Hi ,

I have a date stored in a macro variable (RUN_DATE) which is resolving to 06NOV2019.

I want to store this value in a oracle table with number format like 20191106.

In SAS DI studio I  tried using input(&RUN_DATE,DATE9.) in the expression column  and in format I selected yymmdd10.

 

But its giving error  ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, , =, , =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.  Line 3,986: ERROR 76-322: Syntax error, statement will be ignored.

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
kk21
Fluorite | Level 6

Now I used two transformations ,first is Extract in that did the same thing (INPUT("&RUN_DATE.",DATE9.)) as RUN_DATE but format I used  now  is yymmddn10(before it was yymmdd10.)

Next I used table loader transformation in that I used (input(put(RUN_DATE,yymmddn8.),best12.)) as RUN_DATE.

And it worked fine for me.

 

Thanks all for your valuable suggestions.

View solution in original post

6 REPLIES 6
Astounding
PROC Star
I'm not a DI user, so this answer relies on you knowing the correct steps to use.

Try adding double quotes:

input("&RUN_DATE", date9.)
kk21
Fluorite | Level 6

Double quotes also not working

PaigeMiller
Diamond | Level 26

Show us the LOG, so we can see the code you are using and also the error messages.

 

Please copy the log AS TEXT, then here in the SAS Communities, click on the {i} icon and paste the log AS TEXT into the window that appears. Do not skip this step.

--
Paige Miller
ballardw
Super User

@kk21 wrote:

Hi ,

I have a date stored in a macro variable (RUN_DATE) which is resolving to 06NOV2019.

I want to store this value in a oracle table with number format like 20191106.

In SAS DI studio I  tried using input(&RUN_DATE,DATE9.) in the expression column  and in format I selected yymmdd10.

 

But its giving error  ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, , =, , =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.  Line 3,986: ERROR 76-322: Syntax error, statement will be ignored.

 

Please help.


An error message without code is like calling a mechanic over the phone and asking why is my car not running.

 

kk21
Fluorite | Level 6
Boss code is that much only INPUT("&RUN_DATE.",DATE9.) as RUN_DATE format yymmdd10.
kk21
Fluorite | Level 6

Now I used two transformations ,first is Extract in that did the same thing (INPUT("&RUN_DATE.",DATE9.)) as RUN_DATE but format I used  now  is yymmddn10(before it was yymmdd10.)

Next I used table loader transformation in that I used (input(put(RUN_DATE,yymmddn8.),best12.)) as RUN_DATE.

And it worked fine for me.

 

Thanks all for your valuable suggestions.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1721 views
  • 0 likes
  • 4 in conversation