LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 4 Sep 2002 07:14:02 -0700
Reply-To:   kiruba <kiruba_jc@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   kiruba <kiruba_jc@HOTMAIL.COM>
Organization:   http://groups.google.com/
Subject:   Macro to read a Vsam using key - Help needed
Content-Type:   text/plain; charset=ISO-8859-1

Hi all , I am very much new to SAS and have just started to learn SAS. With the help of the postings in the LIST i managed to get thru some of my primitive queries...But still i am unable to achieve my requirement. All I need to do is create a MACRO to read a VSAM KSDS using a KEY. I tried so many combinations. One such is

%MACRO DICTCALL(MG=); DATA _NULL_; MKY = "&MG"; INFILE MDICT VSAM KEY = MKY FEEDBACK=FDBK;

IF FDBK = 0 THEN DO; INPUT @11 MNAME $25.; CALL SYMPUT('MNAME',MNAME); STOP; END; ELSE DO; MNAME = 'INVALID'; CALL SYMPUT('MNAME',MNAME); PUT 'INVALID ' ; FDBK =0; _ERROR_=0; END; %MEND DICTCALL;

DATA MAG; INFILE INPT; INPUT @1 MCD $2.; CALL EXECUTE('%DICTCALL(MG= '||MCD||');') RUN; This is what i have tried so far.... I need to get that info(MNAME)in all data step MAG. I tried using SYMPUT & SYMGET ....But I realised that i can't do that by reading one of the earlier posts. As the Call execute will be the last statement to be executed, i can't issue a SYMGET after that. I hope my requirements are clear ... I need to write a MAcro to get the value for a KEY from the VSAM and add that data to the existing input data(KEY + SOME OTHER DATA)... Can anyone help me out of this mess !!!

Thanks, Kiruba


Back to: Top of message | Previous page | Main SAS-L page