Proc MetaLib running froma batch job

Reply
Contributor
Posts: 20

Proc MetaLib running froma batch job

Hi

I have created a program in Enterprise Guide to rename datasets in a library. The last step in the progam is to update the meta data for the library where the dataset names have been changed. I am using Proc Metalib to do this. It works when I run the program in Enterprise Guide.

However when I run the program form a batch job the Proc MetaLib statment fails. Can Proc Metalib be used when running from a batch job. I can see that the other parts of the program are working as I can see that the physical files have been renamed.


My code is

&DataLibrary is a variable that is passed in from the batch script. I use this in various other parts of the program the set the library that is being used.

 

%macro UpdateMetaDataLibrary;

proc metalib;

omr (library=&DataLibrary );

update_rule=(delete);

report;

run;

%mend

UPdateMetaDataLibrary;

The errors I am getting are

NOTE: Line generated by the invoked macro "UPDATEMETADATALIBRARY".
86                           omr (library=&DataLibrary );
6                                           The SAS System            06:19 Thursday, December 6, 2012

                             ___
                             180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "UPDATEMETADATALIBRARY".
86                                                          update_rule=(delete);
                                                            ___________
                                                            180

ERROR 180-322: Statement is not valid or it is used out of proper order.

NOTE: Line generated by the invoked macro "UPDATEMETADATALIBRARY".
86                                                                                  report;
                                                                                    ______
                                                                                    180

ERROR 180-322: Statement is not valid or it is used out of proper order.

87         Quit;

I am using the same ID to run the batch as I am to run the code from Enterprise Guide.

Regards

Andrew

 

New Contributor
Posts: 3

Re: Proc MetaLib running froma batch job

Hey Andrew,

I use it as -

 

proc metalib;

omr (libid="AZ00001Y" repid="A5YCOMFK");

report(type = summary);

update_rule = (delete);

report;

run;

pick up the libid and repid from the properties of the library definition from the data library manager(Management console).

alternately specify the repname -

proc metalib;

omr (library="sas91 lib2" repname="Meta Proc repos" );

update_rule (delete noadd noupdate);

report;

run;

http://support.sas.com/documentation/cdl/en/bidsag/61236/HTML/default/viewer.htm#a003116979.htm


Contributor
Posts: 20

Re: Proc MetaLib running froma batch job

Thanks Krithi

To solve the issue I needed to credentials infront of the Proc MetaLib statment.

http://support.sas.com/documentation/cdl/en/lrmeta/60739/HTML/default/viewer.htm#connectopt.htm

Using the statments below with my settings corrected the issue.

options metapass="sasuser1"

        metaport=8561

        metaprotocol=bridge

        metarepository="myrepos"

        metaserver="a123.us.company.com"

        metauser="myuserid";

run;


Ask a Question
Discussion stats
  • 2 replies
  • 461 views
  • 3 likes
  • 2 in conversation