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

Hello,

 

I have been exploring SAS Viya especially the features related to jobs and job flows. I had two inquiries regarding them:

  • When I create a job using a SAS program. If I do any modifications to the SAS program, then I have to delete the job and create new one using the modified SAS program else the job executed will refer to the SAS program before it was modified. Is there any way to make job read the most recent SAS program automatically?
  • The work session ends after the jobs is successfully completed so the next job in the same flow cannot read the data from the previous job. So how can I make all the jobs read from the same work session?
  • I have to reference the same libname in each job or else it gives me an error. Is there a way to have libname defined in one job and then all the jobs in the same job flow would have the same libname assigned to them without writing that command again?

I appreciate your support!

1 ACCEPTED SOLUTION

Accepted Solutions
gwootton
SAS Super FREQ
1. Correct, when you create a job definition the code is written there, so any later modifications to the program in Studio would not carry over to the job. One way around this would be to use the filesrvc access method to %include the program you are making changes to.

FILESRVC Access Method
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a...

2. The WORK library is specific to a SAS session, so each job would have it's own WORK. You would need to use a library other than WORK if you want it to persist between sessions. You could create a job to create such a library at the beginning of your flow execution and another to delete any tables in it at the end.

3. Depending on the Viya release you could do this in your compute context definition or an autoexec if you want it to apply to all sessions. If you want it just for this flow and it's just one libname statement, you would just add it to the code for each job.
--
Greg Wootton | Principal Systems Technical Support Engineer

View solution in original post

3 REPLIES 3
gwootton
SAS Super FREQ
1. Correct, when you create a job definition the code is written there, so any later modifications to the program in Studio would not carry over to the job. One way around this would be to use the filesrvc access method to %include the program you are making changes to.

FILESRVC Access Method
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p0qapul7pyz9hmn0zfoefj0c278a...

2. The WORK library is specific to a SAS session, so each job would have it's own WORK. You would need to use a library other than WORK if you want it to persist between sessions. You could create a job to create such a library at the beginning of your flow execution and another to delete any tables in it at the end.

3. Depending on the Viya release you could do this in your compute context definition or an autoexec if you want it to apply to all sessions. If you want it just for this flow and it's just one libname statement, you would just add it to the code for each job.
--
Greg Wootton | Principal Systems Technical Support Engineer
Quentin
Super User

Just saying +1 to the idea of using %include in your job to run the program.  I don't use Viya (yet), but for both DI studio jobs (which are deployed and scheduled) and for stored processes, this is the approach I use.  The job itself is just a shell, with an %include statement.  The actually program is stored in a normal .sas file.  So you can edit your program with whatever tool you like, use version control, etc. 

BASUG is hosting free webinars Next up: Mike Raithel presenting on validating data files on Wednesday July 17. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
LinusH
Tourmaline | Level 20

In the current release, the program is bundled with your job definition. I think I heard/read somehwere that it will be possible in future releases to seperate the program from the job. I don't think you have to delete the jobm but a redeplyment is necessary.

https://documentation.sas.com/doc/en/webeditorcdc/v_038/webeditorjobsdg/n0t3wlpws3j796n1wuzm5meqnldr...

 

Data never sleeps