Desktop productivity for business analysts and programmers

Linking a table to a SAS user code

Reply
N/A
Posts: 0

Linking a table to a SAS user code

Hi, I need help.

I'm using EG 3 and currently I have created some SAS codes to be used in the process. How do I link a table to my created SAS codes? Right now when I execute the whole process the sas codes run even if a table that it is dependent on does not exist yet.

Thanks
Contributor
Posts: 25

Re: Linking a table to a SAS user code

Hi JCruz,

what type of code you mean? if you using data step, proc steps then you should be linked to the tables and libraries.

you can share your code with us if it is not confidential.

regards,
N/A
Posts: 0

Re: Linking a table to a SAS user code

Hi Mohamed

It's a data step actually, refer to the codes below.

DATA PASSION2;
SET PASSION1;
LENGTH _ID_INTERNAL $20.
KEY1 $100.
;


_ID_INTERNAL = INTERNAL_IDENTIFICATION_NUMBER;
KEY1 = _ID_INTERNAL||CC;

IF NRIC_FIN_NUMBER = ' ' AND RACE = ' ' AND GENDER = ' ' AND ECONOMIC_STATUS = ' ' AND
HIGHEST_EDUCATIONAL_LEVEL = ' ' THEN DO;
RACE = 'INFORMATION NOT AVAILABLE';
GENDER = 'INFORMATION NOT AVAILABLE';
ECONOMIC_STATUS = 'INFORMATION NOT AVAILABLE';
HIGHEST_EDUCATIONAL_LEVEL = 'INFORMATION NOT AVAILABLE';
END;

RUN;

When I execute the whole process flow, this data step is executed even if table PASSION1 is not yet prepared.

Thanks.
Contributor
Posts: 25

Re: Linking a table to a SAS user code

Hi JCruz,

I suggest to restart all SAS Services and try to execute the code again. if the problem still exist, it means that there is a step within your process before this data step prepare the Passion1 table.

also, you can send me you log file to go through it to give you more help
N/A
Posts: 0

Re: Linking a table to a SAS user code

1) I would recommend you have as part of your project an "Assign Library ..." object that creates an EGTASK libary for that project, pointing to an explicit directory for only that project. It makes maintenance and storage control easier.

2) You can link the table to the code by right clicking on the table and selecting the "Link to ..." menu option.

3) I would recommend changing your code to use:

[pre]
data EGTASK.passion2;
set EGTASK.passion1;
...
[/pre]

4) If you simply run the code task, it will run, independently of whatever else has happened. But, if you select the predecessor table, and select "Run branch from ..." EG will run the code set(s) in sequence, if the link is established (#2 above).
N/A
Posts: 0

Re: Linking a table to a SAS user code

Hi

Problem is on EG 3 there is no "link to.." option when I right click the table.

Rgds
N/A
Posts: 0

Re: Linking a table to a SAS user code

Ahhh,

My apologies, I accidentally ignored that you were on EG3.
The "Assign Library ..." option is a feature of EG4.

It has been over 2 years since I last used EG3, so unfortunately, I cannot be of help.

I would strongly recommend, if I may, to upgrade to 4.1. It is a huge, HUGE, improvement over 3. ! HUGE ! Although, I realize this doesn't help it, it will, a lot. Did I say "HUGE"? enough?

In my opinion, the solution to your problem is to upgrade to EG4.x
N/A
Posts: 0

Re: Linking a table to a SAS user code

Haha thanks for the help, unfortunately the client does not have the budget to upgrade to E.G 4.
Ask a Question
Discussion stats
  • 7 replies
  • 145 views
  • 0 likes
  • 2 in conversation