BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
jblack38
Obsidian | Level 7

I have a SAS program, Save_Audit_History, I created several months ago in Viya SAS Studio (using the Develop SAS Code option in the Viya application menu).  

I scheduled the code to execute on a schedule in the Jobs application in Environment  Manager (Manage Environment in the Viya menu).  I scheduled it by selecting the New option on the Scheduling tab and then selecting the job by browsing to it in the New Job window.

The job recently started getting errors due to CAS data limit.  I added the code

     options casdatalimit=500M;

to increase the limit.  

When the scheduled job runs, it still fails.  When I look at the log for the job, it does not contain my new code.

Do I need to create a new job every time I change the code for a program?

Thanks!

Jerry

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
Yes, when you schedule a job the code gets written into the job object rather than being linked to the program you are saving, so you would need to create a new job. You might consider creating a program that does an %include against your program in the files service using the filename statement's filesrvc access method, then when you edit the code it will run the current version.

FILENAME Statement: FILESRVC Access Method
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a...
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

7 REPLIES 7
acordes
Rhodochrosite | Level 12

Try wrapping the proc sql command in its casl sibling proc fedsq.

 

proc cas;
source MPG_toyota;
'your sql command'
endsource;
fedSQL.execDirect / query=MPG_toyota;
quit;


start from my example

proc cas;
source MPG_toyota;
		create table public.sum22{options replace=true} as 
			select a.sales_res as feb_sales_res, b.sales_res, case when round(a.sales_res-b.sales_res,3)=0 then 1 else 0 end as flag 
               from RISKNOBA.REMA_FEB22_FMT_OUT a inner join RISKNOBA.REMA_DEC21_FMT_OUT b 
			on a.bastidor=b.bastidor  ;
endsource;
fedSQL.execDirect / query=MPG_toyota;
quit;

 

jblack38
Obsidian | Level 7
The problem is that the Viya JOB does not see any changes I make to the code. I even added a new comment line and it did not show up in the job log.
So making these changes to the code will not be seen by the job.
gwootton
SAS Super FREQ
Yes, when you schedule a job the code gets written into the job object rather than being linked to the program you are saving, so you would need to create a new job. You might consider creating a program that does an %include against your program in the files service using the filename statement's filesrvc access method, then when you edit the code it will run the current version.

FILENAME Statement: FILESRVC Access Method
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a...
--
Greg Wootton | Principal Systems Technical Support Engineer
jblack38
Obsidian | Level 7
Thanks Greg!
That is what I suspected.
Good suggestion on using an %include.
nikogallo
Calcite | Level 5

the best practice to optimize the work.

😞

 

nikogallo
Calcite | Level 5
but if the job is included in Jobs-flows must the job included in it also be updated?
gwootton
SAS Super FREQ
When you save the job the code is stored separately from when you created the code, so any changes would require creating the job again.
--
Greg Wootton | Principal Systems Technical Support Engineer

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1393 views
  • 2 likes
  • 4 in conversation