Date: Mon, 16 Jun 2003 16:11:10 -0400
Reply-To: Nathaniel_Wooding@DOM.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nathaniel Wooding <Nathaniel_Wooding@DOM.COM>
Subject: Re: Multiple output files
Content-type: text/plain; charset=us-ascii
Another approach to this problem could be along the following lines:
1) allocate a sequential file with the same record length as your input
data set uses. lets call this Yourid.lib.seq
2) Change your code to read (I typed my changes and I have not tested the
code)
DATA _NULL_ ;
SET FIXANOM ;
BY JOB ;
filename seq 'yourid.lib.seq' disp=old;
file seq;
if first.job then put './ add name=' job;
PUT FF @1 JOB @12 CPUTM ;
run;
3) add a second jobstep to your job or set up a second job with the
following:
//seqtopds exec pgm=iebupdate,parm=new
//sysin dd dsn=yourid.lib.seq,disp=shr
//sysut2 dd dsn=yourid.lib.data,disp=shr insert the proper library name
//sysprint dd sysout=x
//
Of course, for jcl, you want to have the above typed in upper case. You
should find similar code in the MVS companion in the section on Proc
Source, which is a tool that I recommend to any one who is lucky enough to
be using MVS.
Nat Wooding
"Fehd, Ronald J.
(PHPPO)" To: SAS-L@LISTSERV.UGA.EDU
<rjf2@CDC.GOV> cc:
Sent by: "SAS(r) Subject: Re: Multiple output files
Discussion"
<SAS-L@LISTSERV.U
GA.EDU>
06/16/03 03:46 PM
Please respond to
"Fehd, Ronald J.
(PHPPO)"
> From: David Kellerman [mailto:kellermandavid@YAHOO.COM]
> I'm attempting to split a datset into multiple external
> members of a PDS. Can anyone see what is wrong with the
> FILENAME statement?
>
> DATA _NULL_ ;
> SET FIXANOM ;
> BY JOB ;
> CALL EXECUTE('%LET FN = ' || JOB ) ;
> IF NOBS = 1 THEN
> FILENAME FF "TEST.RPT.CNTL(&FN)" DISP=OLD;
> PUT FF @1 JOB @12 CPUTM ;
you may be surprised to learn that your call execute statement
which defines the macro variable FN
executes -after- your filename statement.
but you're way more off base than that
filename is not a statement that you can execute within the data step
since it is a global statement 'used anywhere'
it should certainly not be thought to be conditionally executed
as you have written here
what you want for these multiple external files
is the filevar option of the file statement.
Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov
My computer must be broken:
whenever I ask a wrong question,
I get a wrong answer.
-- Pot-Shots by Ashleigh Brilliant
My computer must be broken:
whenever I instruct it to do something peculiar
it sits awaiting ungarbled commands.
-- RJF2
RTFM: I'm an engineer, I don't get paid to know,
I get paid to know where to look it up.
RTFM: Read The Finite Manual.