BookmarkSubscribeRSS Feed
SYN
Obsidian | Level 7 SYN
Obsidian | Level 7


I have one situation,

I have 3 different .CSV files and using file reader tranformation I have build the job for all 3 csv files.

I want to pass latest files every time using my user written code.

Can you please help me how to pass macro parameters.

Is there any simple way please let me know.

Thanks in advance.

Sreenivasa
3 REPLIES 3
jklaverstijn
Rhodochrosite | Level 12

Hi,

DI 3.4 may not support my approach; I haven't checked. What I do in 4.x, in a nutshell, is to

1) define the CSV in the metadata with a macro variable reference as the filename  (like &csvfile). make certain the generated code wraps this in double quotes or you're stuffed. This may actually be the breaking point for 3.4.

2) define and load a table that holds files present in your input location and keeps track of their processed status, eg through a timestamp.

3) Then in a job process that table in the first step to find out which file must be processed. Stick that value in a macro var. As the next step process the external file you defined in the metadata. Give that step a parameter to transfer the result from step 1 into the macro variable that matches the filename of the CSV file from 1). As a last step (or a subsequent job) mark the file as processed in the table as defined in 2).

Good luck, Jan.

shivas
Pyrite | Level 9

Hi SYN,

Check this link..it might be helpfull

https://communities.sas.com/message/129750#129750

This will help you in making a parameter file and you can resolve that in you DI,One more thing you need to do is to get the latest file.

Thanks,

Shiva

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!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1235 views
  • 0 likes
  • 3 in conversation