|
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
|