BookmarkSubscribeRSS Feed
LuisValença
Calcite | Level 5

I have a transformation inside a job, in DIS, which uses a table to create a new table with a new field which is the concatenation of two fields from the source table.

 

Example:

 

Source table:

....

Postal Code (Postal_Code)     2775-001

Postal Code Name  (Postal_Code_Name)   PAREDE

 

Target:

.....

Postal Code (Postal_Code)     2775-001

Postal Code Name  (Postal_Code_Name)   PAREDE

Postal Code Description (Postal_Code_Desc)   2775-001 PAREDE (New field)

 

How extract, from metadata, this relationship?

 

I intended to get the following relationships for fields

Src (Postal_Code) -> Tgt (Postal_code)

Src(Postal_Code_Name) -> Tgt(Postal_Code_Name)

Src (Postal_Code) -> Tgt (Postal_Code_Desc)

Src (Postal_Code_Name) -> Tgt (Postal_Code_Desc)

 

where Src means Source and Tgt menas Target.

1 REPLY 1
Patrick
Opal | Level 21

@LuisValença

It's nothing I'd attempt doing as it's going to become quite involved.

 

The first thing you've got to figure out is where in Metadata this information is stored. Once you've got this you need to write the code to actually query metadata and pull out this information (SAS data step or Proc Metadata).

 

I've got two approaches to figure out where stuff lives in SAS Metadata.

 

A: Analyse XML

Export your job (.spk), then open this .spk with WinZip or the like, find the relevant XML and search for your expression. Then analyse the XML to figure out the Tag hierarchies as this will tell you how to query metadata.

 

B: Use Metabrowse

Use PC SAS and use METABROWSE

Capture.JPG

 

The dive into the trees to find your expression:

Capture.JPG

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 848 views
  • 0 likes
  • 2 in conversation