09-15-2016 02:58 PM
I have the following program which works on the file ref below but does not seem to work on nref attached which is not output as a continuous file but seems to be wrapping around. Can anyone tell me why and how to correct the problem?
data _null_ ;
infile '/folders/myfolders/bootnew/nREF.CTL' truncover;
/* INPUT CHARACTER FILE*/
input c $1000.;
do i=1 to 2;
myfile='/folders/myfolders/bootnew/nREF' || trim(left(put(i,8.))) || '.ctl';
file dummy filevar=myfile MOD ;
if _n_=2 then do;
if i=1 then do;
c= trim(first_half) || trim(left(put(i,8.))) || last_half;
put c $;
$PROBLEM TWO PEAK SEQUENTIAL ZERO AND FIRST ORDER
$DATA ..\TFIT&i.CSV IGNORE=W
$INPUT ID TIME DV DOSE CMT AMT EVID MDV
$SUB ADVAN5 TRANS1
CL = THETA(3)
V3 = THETA(4)
LOGITT = THETA(6)
TVF1 = 1/(1+EXP(-LOGITT))
F1 = TVF1
K23=KAF ;FIRST ORDER MR TO CENTRAL
K13=KAS ;FLOW FROM MR TO CENTRAL
K30=CL/V3 ;ELIMINATION FROM CENTRAL
Y=CP +CP*ERR(1) + ERR(2)
$THETA (0.05,0.5) ;1)K0
$THETA (0.05,0.8) ;2)KAS
$THETA (60, 200) ;3)CL L/HR
$THETA (30,100) ;4)V3 L
$THETA (0.1,2) ;5)LAG2 HR
$THETA (-10.0 -0.04 1 ) ;6)LOGIT F1
$OMEGA 0.01 0.1
$EST METH=0 MAXEVAL=9999 PRINT=5
;$SIM (123456) ONLYSIM SUBPROBLEMS=1
$TABLE ID AMT TIME DV CMT Y DOSE KAF KAS CL V3 TLAG2 LOGITT
ONEHEADER NOPRINT FILE=MOD.FIT
09-15-2016 04:09 PM
It can be very hard to diagnosis file layout issues when you use a file format other than the original file. A Word document is going to do lots of things when saved that would not occur in a text file.
If your source file is not text, i.e. is a .docx, then that is the first problem.
Lines appearing to wrap are often a symptom of using a UNIX or Apple generated file and reading it on a Windows machine as the line (record) termination is different. Or reading a Windows file on Unix. Hard to say with the attached file as it is not text.
09-15-2016 05:03 PM
I am not sure that I follow your answer since the ref file contained in the post has similar code just more of it. In both files only line do is worked on by the do loop with the rest to be just output unchanged.
The *.docx was posted since the orginal format was not accepted by the post.
09-15-2016 06:20 PM
Do you get errors when running the code? Please post the log if so.
If the DOC is a CODE file then do you see a difference between:
data _null_ ; infile '/folders/myfolders/bootnew/nREF.CTL' truncover; /* INPUT CHARACTER FILE*/ input c $1000.;
$DATA ..\FPLASMA&i.CSV IGNORE=W $INPUT ID TIME CMT DV DROP AMT=DOSE EVID MDV RATE SEX WT $SUBR ADVAN13 TRANS1 TOL=6
Note the $ at the start of staments, no semicolon at thend of statements in the second.
I do not beleive that second file is SAS code at all.
If you are attempting to Read the DOC file, or a text version then there may be issues with layout such as no end of line character recognized by your SAS system.