error FOR3309: undefined label 124 - fortran

I wrote this but when I try to build *.exe say:
Compiling Fortran...
C:\Users\LORD\Desktop\TText1.f90
C:\Users\LORD\Desktop\TText1.f90(197): error FOR3309: undefined label 124
Error executing fl32.exe.
This is the source code of the project:
program one
real::x(6),f(6),deltaf1(6),deltaf2(6),deltaf3(6),deltaf4(6),deltaf5(6)
real::gradf1(6),gradf2(6),gradf3(6),gradf4(6),gradf5(6)
real::h,x1,x2,s1,s2,p1,p2,Y1,Y2
real::Z,T,a,b,c,d
open(unit=16,file="E:\N\xi.txt")
open(unit=148,file="E:\N\fi.txt")
gradf1(:)=0.0
gradf2(:)=0.0
gradf3(:)=0.0
gradf4(:)=0.0
gradf5(:)=0.0
deltaf1(:)=0.0
deltaf2(:)=0.0
deltaf3(:)=0.0
deltaf4(:)=0.0
deltaf5(:)=0.0
do i=0,5
read(16,*)x(i)
read(148,*)f(i)
write(*,12)x(i),f(i)
12 format(2F12.4)
end do
do i=0,4
deltaf1(i)=f(i+1)-f(i)
end do
do i=0,3
deltaf2(i)=deltaf1(i+1)-deltaf1(i)
end do
do i=0,2
deltaf3(i)=deltaf2(i+1)-deltaf2(i)
end do
do i=0,1
deltaf4(i)=deltaf3(i+1)-deltaf3(i)
write(*,*)deltaf4(i)
end do
deltaf5(5)=deltaf4(1)-deltaf4(0)
write(*,*)deltaf5(5)
do i=1,5
gradf1(i)=f(i)-f(i-1)
write(*,55)gradf1(i)
55 format(F12.4)
end do
do i=2,5
gradf2(i)=gradf1(i)-gradf1(i-1)
write(*,65)gradf2(i)
65 format(F12.4)
end do
do i=3,5
gradf3(i)=gradf2(i)-gradf2(i-1)
end do
do i=4,5
gradf4(i)=gradf3(i)-gradf3(i-1)
write(*,124)gradf4(i)
end do
gradf5(5)=gradf4(5)-gradf4(4)
write(*,155)gradf5(5)
155 format(F12.4)
h=x(1)-x(0)
x1=0.5
s1=(x1-x(0))/h
write(*,33)s1
33 format(F12.4)
!p(x)=fi(0)+s*deltafi1(0)+(1/2)*s*(s-1)*deltafi2(0)+(1/6)*s*(s-1)*(s-2)*deltafi3(0)+(1/24)*s*(s-1)*(s-2)*(s-3)*deltafi4(0)+(1/120)*s*(s-1)*(s-2)*(s-3)*(s-4)*deltafi5(0)
p1=f(0)+s1*deltaf1(0)+(1/2)*s1*(s1-1)*deltaf2(0)+(1/6)*s1*(s1-1)*(s1-2)*deltaf3(0)+(1/24)*s1*(s1-1)*(s1-2)*(s1-3)*deltaf4(0)+(1/120)*s1*(s1-1)*(s1-2)*(s1-3)*(s1-4)*deltaf5(0)
write(*,*)" vaghti x1=0.5 chand jomleie pishro barabar ast ba=",p1
x2=0.45
s2=(x2-x(0))/h
p2=f(0)+s2*deltaf1(0)+(1/2)*s2*(s2-1)*deltaf2(0)+(1/6)*s2*(s2-1)*(s2-2)*deltaf3(0)+(1/24)*s2*(s2-1)*(s2-2)*(s2-3)*deltaf4(0)+(1/120)*s2*(s2-1)*(s2-2)*(s2-3)*(s2-4)*deltaf5(0)
write(*,*)"vaghti x2=0.45 chand jomleie pishro barabar ast ba=",p2
!Y(x)=fi(5)+s*gradfi1(5)+(1/2)*s*(s+1)*gradfi2(5)+(1/6)*s*(s+1)*(s+2)*gradfi3(5)+(1/24)*s*(s+1)*(s+2)*(s+3)*gradfi4(5)+(1/120)*s*(s+1)*(s+2)*(s+3)*(s+4)*gradfi5(5)
Y1=f(5)+s1*gradf1(5)+(1/2)*s1*(s1+1)*gradf2(5)+(1/6)*s1*(s1+1)*(s1+2)*gradf3(5)+(1/24)*s1*(s1+1)*(s1+2)*(s1+3)*gradf4(5)+(1/120)*s1*(s1+1)*(s1+2)*(s1+3)*(s1+4)*gradf5(5)
write(*,*)"vaghti x1=0.5 chand jomleie pishro barabar ast ba=",Y1
Y2=f(5)+s2*gradf1(5)+(1/2)*s2*(s2+1)*gradf2(5)+(1/6)*s2*(s2+1)*(s2+2)*gradf3(5)+(1/24)*s2*(s2+1)*(s2+2)*(s2+3)*gradf4(5)+(1/120)*s2*(s2+1)*(s2+2)*(s2+3)*(s2+4)*gradf5(5)
write(*,*)"vaghti x2=0.45 chand jomleie pasro barabar ast ba=",Y2
T=abs(p1-Y1)
Z=abs(p2-Y2)
write(*,*)"tafazole chand jomleie pishro va pasro baraye x1=0.5 barabar ast ba=",T
write(*,*)"tafazole chand jomleie pishro va pasro baraye x2=0.45 barabar ast ba=",Z
! tabe W ra be in shekl benvis=exp(2*x)
!W=exp(2*x)
W1=exp(2*x1)
W2=exp(2*x2)
a=abs(p1-W1)
b=abs(p2-W2)
c=abs(Y1-W1)
d=abs(Y2-W2)
write(*,*)"tafazole chand jomleie pishro va tabe W mord nazar dr noghte x1=0.5 mishavad=",a
write(*,*)"tafazole chand jomleie pishro va tabe W mord nazar dr noghte x2=0.45 mishavad=",b
write(*,*)"tafazole chand jomleie pasro va tabe W mord nazar dr noghte x1=0.5 mishavad=",c
write(*,*)"tafazole chand jomleie pasro va tabe W mord nazar dr noghte x2=0.45 mishavad=",d
stop
end program one

I could say that the problem is that you're using Microsoft Fortran PowerStation, that was discontinued in 1997, but...
You have the line:
write(*,124)gradf4(i)
That 124 is supposed to be the label of a format, but you have no format labeled 124. You do have a format labeled 12 - maybe that's what is wanted.
Here's what a modern compiler might tell you:
t.f90(105): error #6052: This label has not been defined as a FORMAT label. [124]
write(*,124)gradf4(i)
------------^

Related

Is there a way to display the last part of my code ? The output of the last code lines doesn't appear

I am trying to execute a code using the gfortran compiler.
In order to compile, I use :
gfortran -O3 hecese_seq.f90
In order to execute, I use :
./a.out
The code is below:
compteur_tempo=0
do while (.not.fin)
compteur_tempo=compteur_tempo+1
duree = duree+dt
do pas=1,2
tab0(:,:) =tab(:,:)
!----------- CE/SE
if(pas.eq.1)then
do i=1,cpt,2
flux(i)= tab0(i,3)*grad_x_u(i)
sm(i)= dt/(dx)*flux(i) + dt**2/(4.0d0*dx)*grad_t_f(i) + dx/4.0*grad_x_u(i)
enddo
do i=2,cpt-1,2
tab(i,2)= 0.5d0*( tab0(i+1,2)+tab0(i-1,2)+sm(i-1)-sm(i+1)) !-------Coord paires
enddo
else
do i=2,cpt,2
flux(i)= tab0(i,3)*grad_x_u(i)
sm(i)= dt/(dx)*flux(i) + dt**2/(4.0d0*dx)*grad_t_f(i) + dx/4.0*grad_x_u(i)
enddo
do i=3,cpt-1,2
tab(i,2)= 0.5d0*( tab0(i+1,2)+tab0(i-1,2)+sm(i-1)-sm(i+1)) !-------Coord impaires
enddo
endif
!-------------- Traitement des interfaces - continuité du flux par la conductivité thermique
do j=2,nb_element
i = p_element(j)
tab(i,2)=(tab(i-1,7)*tab(i-1,2)+tab(i+1,7)*tab(i+1,2))/(tab(i-1,7)+tab(i+1,7))
enddo
!-------------- Conditions cyclique sur la température
tab(1,2)= 0.5d0*( tab0(2,2)+tab0(cpt-1,2)+sm(cpt-1)-sm(2))!2*dt/dx*(flux(1))-sm(2)-sm(1)+tab(2,2)!tab(2,2)!2000/T_ref!
tab(cpt,2)=tab(1,2)!(-2*dt/dx)*flux(cpt)+sm(cpt-1)+sm(cpt)+tabi(cpt-1,2)!2000/T_ref!
goto 113
!---------------Resolution par Newton raphson - Actuellement inutilisé, je le laisse au cas où
error=0.0d0
test1=.true.
itermax =10
rhs(:)=tab(:,2)
iter =0
eps=1.0d-10
DeltaT=1.0d-10
sh(:)=0
f1(:)=0
f2(:)=0
delt(:)=0
do while((test1).and.(iter.le.itermax))
iter = iter+1
Call GRAD
do j=pas+1,cpt-1,2
sh(j)=tab(j,7)*tab(j,8)*grad_x_u(j)
fluxnr(j) = -(tab(j,2)+(dt/2)*sh(j)-rhs(j))
Delt(j)=fluxnr(j)
tab(j,2) =tab(j,2)+delt(j)
enddo
error=0.0d0
do j=2,cpt-1!,2!1,nb_element!
error = max(error, abs(delt(j)))
enddo
if(iter.eq.itermax)then
write(6,*)'itermax'
endif
test1=abs(error).ge.eps!.or.dabs(error).eq.0.0d0
enddo
!---------------Resolution des gradients
113 continue
CALL GRAD
do i=pas+1,cpt-1,2
grad_x_f(i)= tab(i,3)*(tab(i+1,2)-2.0*tab(i,2)+tab(i-1,2))/(dx**2)!(Différence centrée deuxième ordre (dérivée seconde de la Temp)
grad_t_u(i) = -grad_x_f(i)+tab(i,7)*grad_x_u(i)*tab(i,8)/2!(Terme source ajouté ici seulement - Légère influence sur les interfaces)
grad_t_f(i) = grad_x_f(i)*tab(i,3)/(cfl*dx)!(Terme en dx/dt remplacé par tab(i,3)/(cfl*dx))
enddo
!------ Conditions cyclique - Gradients
grad_x_f(cpt)=grad_x_f(cpt-1)
grad_x_f(1)=grad_x_f(cpt)
grad_t_u(cpt)=grad_t_u(cpt-1)
grad_t_u(1)=grad_t_u(cpt)
grad_t_f(cpt)=grad_t_f(cpt-1)
grad_t_f(1)=grad_t_f(cpt)
!------ Gradients moyennés sur l'interface (histoire de limiter les discontinuités)
do j=2,nb_element
i = p_element(j)
grad_x_f(i)=(grad_x_f(i+1)+grad_x_f(i-1))/2
grad_t_u(i)=(grad_t_u(i+1)+grad_t_u(i-1))/2
grad_t_f(i)=(grad_t_f(i+1)+grad_t_f(i-1))/2
enddo
enddo
!-------------- Test de la fonte de l'electrolite
test = .false.
i_ca_el = p_element(num)
i_el_an = p_element(num+1)
i=i_ca_el
do while(((i.lt.i_el_an-1).and.(.not.test)))
test=tab(i,2).le.(T_fonte)!20000)! Choix entre température d'équilibre ou température de fonte
i = i+1
enddo
if(i.ge.i_el_an-1)convergence =.true.
if(convergence) then
write(6,*)'Convergence',i, i_ca_el,i_el_an-1, duree*time_ref
else
write(6,'(''Non Convergence'', 3i5,3f18.12)'),i, i_ca_el,i_el_an-1,tab(i,2)*t_ref,duree*time_ref
endif
if(.not.stock)then
if( convergence.and.(duree.lt.duree_totale))then
open(10,file='test'//char(ww+48)//'.dat', status='unknown')
do i=1,cpt
write(10,*)tab(i,1)*l_ref,tab(i,2)*t_ref
enddo
close(10)
stock=.true.
stop
endif
endif
fin=duree.ge.duree_totale
pas_stockage = pas_stockage+dt
if(pas_stockage.ge.intervalle_stockage)then
do i=1,nb_probe
write(w_output(i),*)duree*time_ref, tab(probe_indice(i),2)*t_ref
enddo
pas_stockage =0.0d0
endif
enddo
!execution time
CALL CPU_TIME(TIME_END)
call system_clock(count=t2, count_rate=ir)
write(*,*)" duree = ",duree,duree*time_ref
write(*,*)"compteur temporel ",compteur_tempo
write(*,*)"cpt ",cpt
write(*,*)" temps d’excecution du programme",TIME_END-TIME_START
temps=real(t2 - t1 ,kind =8)/real(ir,kind =8)
write (*,*) "temps d’exe du programme:",temps
do i=1,nb_probe
close(w_output(i))
enddo
For the part testing the convergence, it's okay but I don't get the execution time as I wanted to display it. I feel that the last part doesn't get executed. (maybe due to the "Stop" used for testing the convergence).
For the execution, I get:
Non Convergence 222 184 303 699.993372185986 0.340103428568
Non Convergence 222 184 303 699.993948217854 0.340103999997
Non Convergence 222 184 303 699.994524248306 0.340104571426
Non Convergence 222 184 303 699.995100277341 0.340105142854
Non Convergence 222 184 303 699.995676304960 0.340105714283
Non Convergence 222 184 303 699.996252331162 0.340106285711
Non Convergence 222 184 303 699.996828355948 0.340106857140
Non Convergence 222 184 303 699.997404379318 0.340107428568
Non Convergence 222 184 303 699.997980401271 0.340107999997
Non Convergence 222 184 303 699.998556421807 0.340108571426
Non Convergence 222 184 303 699.999132440928 0.340109142854
Non Convergence 222 184 303 699.999708458632 0.340109714283
Non Convergence 222 184 303 700.000284474919 0.340110285711
Non Convergence 222 184 303 700.000860489791 0.340110857140
Non Convergence 222 184 303 700.001436503245 0.340111428568
Non Convergence 222 184 303 700.002012515283 0.340111999997
Non Convergence 222 184 303 700.002588525905 0.340112571426
Non Convergence 222 184 303 700.003164535111 0.340113142854
Non Convergence 222 184 303 700.003740542900 0.340113714283
Non Convergence 222 184 303 700.004316549273 0.340114285711
Non Convergence 222 184 303 700.004892554230 0.340114857140
Non Convergence 222 184 303 700.005468557770 0.340115428568
Non Convergence 222 184 303 700.006044559894 0.340115999997
Non Convergence 222 184 303 700.006620560601 0.340116571426
Non Convergence 222 184 303 700.007196559892 0.340117142854
Convergence 303 184 303 0.34011771428275706
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
I showed you a small part of the execution (there are a lot of values so no need to show them all).
My problem is that I can't display the execution time while it has been already implemented. I'm new on this website so I hope you can help me.
Your structure basically is
do
!do something
if (convergence) STOP
end do
That means that at convergence the program stops completely and you never get past the loop.
To be able to continue execution after the loop you want to just exit the loop.
do
!do something
if (convergence) EXIT
end do
!further statements

All unique combinations of given length from list of values in Libre Office

I have several, let's say six, different values. Can be numbers from 1 to 6.
I want to quickly list all unique combinations of four, so 1-2-3-4, 1-2-3-5 ... 3-4-5-6, all of them, but without any numbers showing more than once.
I'd like to do it in Libre Office Calc or Libre Office Base, but thus far I haven't had much luck searching for a way to do it. I'd be really grateful for any ideas.
there you go:
1234 1235 1236 1243 1245 1246 1253 1254 1256 1263 1264 1265 1324 1325 1326 1342 1345 1346 1352 1354 1356 1362 1364 1365 1423 1425 1426 1432 1435 1436 1452 1453 1456 1462 1463 1465 1523 1524 1526 1532 1534 1536 1542 1543 1546 1562 1563 1564 1623 1624 1625 1632 1634 1635 1642 1643 1645 1652 1653 1654 2134 2135 2136 2143 2145 2146 2153 2154 2156 2163 2164 2165 2314 2315 2316 2341 2345 2346 2351 2354 2356 2361 2364 2365 2413 2415 2416 2431 2435 2436 2451 2453 2456 2461 2463 2465 2513 2514 2516 2531 2534 2536 2541 2543 2546 2561 2563 2564 2613 2614 2615 2631 2634 2635 2641 2643 2645 2651 2653 2654 3124 3125 3126 3142 3145 3146 3152 3154 3156 3162 3164 3165 3214 3215 3216 3241 3245 3246 3251 3254 3256 3261 3264 3265 3412 3415 3416 3421 3425 3426 3451 3452 3456 3461 3462 3465 3512 3514 3516 3521 3524 3526 3541 3542 3546 3561 3562 3564 3612 3614 3615 3621 3624 3625 3641 3642 3645 3651 3652 3654 4123 4125 4126 4132 4135 4136 4152 4153 4156 4162 4163 4165 4213 4215 4216 4231 4235 4236 4251 4253 4256 4261 4263 4265 4312 4315 4316 4321 4325 4326 4351 4352 4356 4361 4362 4365 4512 4513 4516 4521 4523 4526 4531 4532 4536 4561 4562 4563 4612 4613 4615 4621 4623 4625 4631 4632 4635 4651 4652 4653 5123 5124 5126 5132 5134 5136 5142 5143 5146 5162 5163 5164 5213 5214 5216 5231 5234 5236 5241 5243 5246 5261 5263 5264 5312 5314 5316 5321 5324 5326 5341 5342 5346 5361 5362 5364 5412 5413 5416 5421 5423 5426 5431 5432 5436 5461 5462 5463 5612 5613 5614 5621 5623 5624 5631 5632 5634 5641 5642 5643 6123 6124 6125 6132 6134 6135 6142 6143 6145 6152 6153 6154 6213 6214 6215 6231 6234 6235 6241 6243 6245 6251 6253 6254 6312 6314 6315 6321 6324 6325 6341 6342 6345 6351 6352 6354 6412 6413 6415 6421 6423 6425 6431 6432 6435 6451 6452 6453 6512 6513 6514 6521 6523 6524 6531 6532 6534 6541 6542 6543
PS: i don't think that there is a way to generate them in libre office, since i'm not aware of programming languages in that program, however you can compute them online or with a your script
If you need the script, save this code in a .html file and open it in a browser
<html>
<body>
<script>
function finish(arr, n){
for(let el in arr)
if(el != n)
return true;
return false;
}
function updateIndexes(arr, n){
for( i = 0; i < arr.length ; i++ ){
if(arr[i] < n-1){
arr[i]++;
return true;
}
arr[i] = 0;
}
return false
}
let from = [1,2,3,4,5,6].map((el)=>el.toString());
let length = 4;
let separator = '-'
let indexes = Array(length).fill().map(el=>el=0);
let results = [];
do{
results.push(indexes.map(index => from[index]).join(separator));
} while (updateIndexes(indexes, from.length));
body = document.getElementsByTagName('body')[0];
results.filter((el)=>{
for(i = 0; i < el.length ; i++)
for(j = i+1 ; j < el.length ; j++)
if(el.charAt(i) == el.charAt(j) && el.charAt(i) != separator)
return false;
return true;
}).forEach(el => body.innerHTML+= el.toString()+'<br>');
</script>
</body>
</html>
what you can customize is:
let from = [1,2,3,4,5,6]; to what numbers/letters you want
let length = 4; to the length of the string you want
let separator = '-' to the separator you want (the separator here intended is the one between each sequence generated, so in this case will be 1-2-3-4 for example)
Python has a library called itertools that does this.
import itertools
l = itertools.permutations(range(1,7), 4) # between 1 and 6 of length 4
for t in list(l):
print("{}, ".format("-".join(str(i) for i in t)), end='')
Result:
1-2-3-4, 1-2-3-5, 1-2-3-6, 1-2-4-3, 1-2-4-5, 1-2-4-6, 1-2-5-3, 1-2-5-4, 1-2-5-6, 1-2-6-3, 1-2-6-4, 1-2-6-5, 1-3-2-4, 1-3-2-5, 1-3-2-6, 1-3-4-2, 1-3-4-5, 1-3-4-6, 1-3-5-2, 1-3-5-4, 1-3-5-6, 1-3-6-2, 1-3-6-4, 1-3-6-5, 1-4-2-3, 1-4-2-5, 1-4-2-6, 1-4-3-2, 1-4-3-5, 1-4-3-6, 1-4-5-2, 1-4-5-3, 1-4-5-6, 1-4-6-2, 1-4-6-3, 1-4-6-5, 1-5-2-3, 1-5-2-4, 1-5-2-6, 1-5-3-2, 1-5-3-4, 1-5-3-6, 1-5-4-2, 1-5-4-3, 1-5-4-6, 1-5-6-2, 1-5-6-3, 1-5-6-4, 1-6-2-3, 1-6-2-4, 1-6-2-5, 1-6-3-2, 1-6-3-4, 1-6-3-5, 1-6-4-2, 1-6-4-3, 1-6-4-5, 1-6-5-2, 1-6-5-3, 1-6-5-4, 2-1-3-4, 2-1-3-5, 2-1-3-6, 2-1-4-3, 2-1-4-5, 2-1-4-6, 2-1-5-3, 2-1-5-4, 2-1-5-6, 2-1-6-3, 2-1-6-4, 2-1-6-5, 2-3-1-4, 2-3-1-5, 2-3-1-6, 2-3-4-1, 2-3-4-5, 2-3-4-6, 2-3-5-1, 2-3-5-4, 2-3-5-6, 2-3-6-1, 2-3-6-4, 2-3-6-5, 2-4-1-3, 2-4-1-5, 2-4-1-6, 2-4-3-1, 2-4-3-5, 2-4-3-6, 2-4-5-1, 2-4-5-3, 2-4-5-6, 2-4-6-1, 2-4-6-3, 2-4-6-5, 2-5-1-3, 2-5-1-4, 2-5-1-6, 2-5-3-1, 2-5-3-4, 2-5-3-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3-2-5, 6-3-4-1, 6-3-4-2, 6-3-4-5, 6-3-5-1, 6-3-5-2, 6-3-5-4, 6-4-1-2, 6-4-1-3, 6-4-1-5, 6-4-2-1, 6-4-2-3, 6-4-2-5, 6-4-3-1, 6-4-3-2, 6-4-3-5, 6-4-5-1, 6-4-5-2, 6-4-5-3, 6-5-1-2, 6-5-1-3, 6-5-1-4, 6-5-2-1, 6-5-2-3, 6-5-2-4, 6-5-3-1, 6-5-3-2, 6-5-3-4, 6-5-4-1, 6-5-4-2, 6-5-4-3,
LibreOffice allows Python scripting, so the code can be added to Calc or Base by including it in a Python-UNO macro.

Error reading last line of file and inputing into Linklist

So I'm working on an assignment for my class in which I have to read in data from a file and create a doubly linked list with it. I have all the difficult stuff done, now I'm just running into the problem where my program throws a bunch of random characters and kills itself on the last line.
Here is the function that is reading in the data and inserting it into my link list. My professor wrote this, so to be frank, I don't understand it very well.
void PropogateTheList(ifstream & f, LinkList & ML)
{
static PieCake_struct * record;
record= new PieCake_struct;
f>>record->id>>record->lname>>record->fname>>record->mi>>record->sex>>record->pORc;
while(!f.eof())
{
ML.Insert(record);
record = new PieCake_struct;
f>>record->id>>record->lname>>record->fname>>record->mi>>record->sex>>record->pORc;
}
}
Here is the data that is being propagated:
1 Abay Harege N O C
2 Adcock Leand R F P
3 Anderson Logan B M P
5 Bautista Gloria A F P
10 Beckett Dallas B F C
12 Ambrose Bridget C F C
13 Beekmann Marvin D M P
14 Bacaner Tate D M C
16 Bis Daniel F M P
18 Dale Kaleisa G F C
19 DaCosta Ricardo H M P
23 Adeyemo Oluwanifemi I M C
24 Berger Chelsea J F C
38 Daniels Jazmyn K F P
39 Davis Takaiyh L F C
40 DeJesus Gabriel M M P
51 Castro Floriana N F P
52 Chen Justin O M C
53 Clouden Ariel P F P
54 Conroy Cameron Q M C
61 Contreras Dominic R M P
62 Cooley Kyle S M C
63 Creighton Cara T F P
64 Cullen William U M C
66 Blakey Casey V M C
67 Barbosa Anilda W F P
83 Brecher Benjamin X M P
84 Boulos Alexandre Y F C
85 Barrios Joshua Z M C
85 Bonaventura Nash A M P
86 Bohnsack David B M C
87 Blume Jeffrey C M P
90 Burgman Megan D F C
91 Bursic Gregory E M P
92 Calvo Sajoni F F C
93 Cannan Austin G M P
94 Carballo Nicholas H M C
99 AlbarDiaz Matias I F P
Currently, I sort the data alphabetically based off the last name, so on about the 5th line, when it tries to print out number 99 (AlabraDiaz) it dies. If I sort the list another way, the program always messes up with whatever the last line of data is. Any help would be great!
UPDATE:
So I've tried implementing an if(!.eof()) before inserting but it unfortunately doesn't do anything. I deleted the last of data, thus making the person Carballo. This is what my function prints out:
****** The CheeseCake Survey ******
Id Last Name First Name MI Sex Pie/Cake
-- -------- --------- -- --- --------
2 Adcock
23 Adeyemo
12 Ambrose
3 Anderson
14 Bacaner
67 Barbosa
85 Barrios
5 Bautista
10 Beckett
13 Beekmann
24 Berger
16 Bis
66 Blakey
87 Blume
86 Bohnsack
85 Bonaventura
84 Boulos
83 Brecher
90 Burgman
91 Bursic
92 Calvo
93 Cannan
0 Carballo????NicholasA8?zL`8?zL`A8?zL`8?zL`??
Wouldn't it be better if you'd read from the stream first, then check if it's in eof state and based on that you'd insert the element? I'm writing the following code without compiler's help, here in the edit box, so apologises if I'd made any mistake. Of course the question arises or something I'd think of is what will happen if you'll try to read from your f stream in case where eof results in true. To read more about it you can check the following link:
Why is iostream::eof inside a loop condition (i.e. `while (!stream.eof())`) considered wrong?
void PropogateTheList(ifstream & f, LinkList & ML)
{
while(!f.eof())
{
static PieCake_struct * = new PieCake_struct;
f>>record->id>>record->lname>>record->fname>>record->mi>>record->sex>>record->pORc;
if(!f.eof())
ML.Insert(record);
}
}

Repeating Capture Groups Regex

I have a large chunk of class data that I need to run a regular expression on and get data back from. The problem is that I need a repeating capturing group in order to acomplish that.
Womn St 157A QUEERHISTORY MAKING
CCode Typ Sec Unt Instructor Time Place Max Enr Req Rstr Status
32680 LEC A 4 SHAH, P. TuTh 11:00-12:20p IAB 131 35 37 60 FULL
Womn St 171 SEX/RACE & CONQUEST
CCode Typ Sec Unt Instructor Time Place Max Enr Req Rstr Status
32710 LEC A 4 O'TOOLE, R. TuTh 2:00- 3:20p DBH 1300 52 13/45 24 OPEN
~ Same as 25610 (GlblClt 103B, Lec A); 26350 (History 169, Lec A); and
~ 60320 (Anthro 139, Lec B).
32711 DIS 1 0 MONSON, A. W 9:00- 9:50 HH 105 25 5/23 8 OPEN
O'TOOLE, R.
~ Same as 25612 (GlblClt 103B, Dis 1); 26351 (History 169, Dis 1); and
~ 60321 (Anthro 139, Dis 1).
The result I need would return two matches
Match
Group1:Womn St 157A
Group2:QUEERHISTORY MAKING
Group3:32680
Group4:LEC
Group5:A
Group6:SHAH, P.
Group7:TuTh 11:00-12:20p
Group8:IAB 13
Match
Group1:Womn St 171
Group2:SEX/RACE & CONQUEST
Group3:32710
Group4:LEC
Group5:A
Group6:O'TOOLE, R.
Group7:TuTh 2:00- 3:20p
Group8:DBH 1300
Group9:25610
Group10:26350
Group11:60320
Group12:32711
Group13:DIS
Group14:1
Group15:MONSON, A.
Group16: W 9:00- 9:50
Group17:HH 105
Group18:25612
Group19:26351
Group20:60321

SAS - plot actual and ARIMA model

How to plot in SAS, the estimated ARIMA model with the actual data on the same graph? The plot I've got, using the code below, does not show the actual and the model clearly. The model estimated is MA(15).
data project;
input dj 1-6 aus 7-14;
datalines;
3651 1962.2
3645 1977.1
3626 1968.4
3634 1952.0
3620.5 1962.5
3607 1967.8
3589 1939.5
3590 1931.4
3622 1941.5
3634 1938.3
3616 1912.9
3634 1903.6
3631 1902.6
3613 1925.5
3576 1924.1
3537 1925.2
3547 1919.3
3540 1928.6
3543 1946.5
3568 1943.0
3566 1942.3
3566 1951.4
3555 1964.4
3581 1972.7
3578 1977.0
3587 1998.5
3599 2018.8
3584 2022.5
3585 2026.2
3593 2039.8
3593 2028.0
3603 2038.6
3622 2062.0
3630 2074.1
3642 2085.5
3635 2075.5
3645 2051.7
3636 2060.4
3649 2061.4
3674 2046.9
3672 2055.7
3665 2068.3
3688 2076.3
3681 2112.2
3693 2132.4
3698 2125.3
3662 2108.4
3625 2101.6
3643 2079.9
3648 2054.2
3640 2050.8
3664 2042.9
3662 2052.4
3684 2074.0
3678 2082.9
3711 2083.8
3704 2104.3
3685 2108.0
3694 2083.2
3670 2049.3
3674 2009.6
3688 2032.4
3686 2042.0
3684 2043.1
3678 2010.3
3684 2009.4
3697 2005.4
3702 2047.3
3704 2047.4
3710 2053.7
3719 2073.9
3734 2096.0
3730 2095.7
3741 2084.9
3764 2094.5
3743 2086.6
3717 2069.9
3726 2074.8
3752 2080.2
3755 2076.0
3745 2067.0
3762 2053.2
3758 2068.8
3776 2089.2
3794 2126.9
3776 2154.5
3757 2173.6
3784 2174.3
3799 2193.4
3804 2200.3
3821 2186.0
3866 2198.6
3850 2206.7
3849 2195.6
3842 2177.5
3867 2206.4
3870 2238.2
3870 2232.1
3884 2248.2
3892 2266.2
3914 2250.3
3913 2224.5
3895 2221.9
3926 2250.7
3945 2259.9
3978 2310.8
3964 2310.1
3976 2312.1
3968 2340.6
3871 2332.8
3906 2281.1
3906 2305.4
3932 2270.9
3895 2234.3
3895 2241.4
3904 2238.6
3928 2234.0
3937 2249.0
3923 2240.9
3888 2223.2
3900 2178.5
3912 2202.5
3892 2218.9
3840 2197.0
3839 2148.8
3832 2180.1
3809 2181.7
3832 2154.0
3824 2151.4
3832 2116.8
3856 2144.7
3852 2171.7
3853 2146.8
3831 2155.1
3863 2153.1
3863 2179.3
3850 2172.5
3848 2173.5
3865 2164.4
3896 2163.5
3865 2140.5
3863 2140.8
3869 2180.9
3821 2169.8
3775 2151.6
3762 2108.9
3699 2100.8
3627 2092.4
3636 2053.1
3675 2050.0
3680 2084.1
3693 2087.4
3674 2082.0
3689 2076.0
3682 2095.1
3662 2114.7
3663 2095.0
3662 2080.6
3620 2095.9
3620 2061.4
3599 2046.6
3653 2029.6
3649 2042.5
3700 2069.4
3684 2059.7
3668 2069.1
3682 2066.1
3701 2047.9
3714 2044.2
3698 2018.4
3696 1988.1
3670 2004.3
3629 2009.3
3656 2008.2
3629 2034.6
3653 2041.4
3660 2070.0
3672 2110.9
3721 2096.0
3733 2107.8
3759 2093.7
3766 2103.9
3742 2121.0
3745 2132.4
3755 2105.9
3754 2096.9
3757 2102.2
3757.5 2091.8
3758 2081.8
3761 2097.2
3759 2077.0
3772 2078.6
3768 2072.5
3756 2070.2
3749 2079.7
3753 2076.7
3773 2069.4
3815 2076.6
3790 2074.4
3811 2056.0
3777 2051.2
3742 2024.4
3708 1993.6
3725 2010.9
3699 2022.5
3637 2017.9
3686 1957.4
3670 1974.4
3667 1975.1
3625 1989.1
3647 1965.8
3649.5 1987.1
3652 2003.4
3674 1991.2
3688 1962.2
3709 1964.9
3703 1961.2
3703 1972.9
3704 1978.6
3739 2007.7
3754 2058.0
3755 2072.3
3748 2077.4
3727 2078.6
3732 2049.2
3735 2052.5
3742 2048.3
3736 2041.3
3720 2041.7
3731 2042.1
3764 2061.5
3798 2082.1
3796 2086.9
3793 2072.3
3766 2083.5
3747 2091.9
3754 2081.1
3756 2086.8
3767 2076.5
3751 2062.8
3769 2052.0
3760 2055.9
3785 2040.0
3776 2059.5
3755 2066.8
3755 2061.3
3751 2063.6
3776 2051.6
3847 2061.1
3830 2077.8
3881 2077.2
3899 2111.8
3917 2116.5
3913 2122.1
3901 2105.5
3886 2107
3892.5 2095.5
3899 2103.6
3886 2104.4
3908 2089.1
3875 2070.6
3860 2032.9
3880 2043.6
3895 2050.5
3954 2050.8
3933 2059
3937 2049.1
3869 2045.1
3852 2026.6
3837 2028.2
3832 2027.7
3849 2030
3863 2013.8
3878 2014.2
3855 2030.6
3843 2028.7
3847 2030.9
3801 1998
3787 1979.8
3776 1976.3
3797 1967.5
3821 1988
3877 2003.6
3875 2002.6
3890 1998.9
3910 2006
3924 2014.2
3918 2003.4
3936 2013.4
3911 2016.3
3891 2034.6
3855 2034.2
;
run;
proc print data= project;
run;
proc arima data=project;
identify var=aus
run;
proc arima data = project plots(only)=(forecast(FORECAST));
identify var=aus(1) nlag=20;
estimate q=(1,15);
forecast lead = 90 out= results;
run;
I'd suggest using the new SAS GTL (graphics template language) to do it. Plenty of examples can be found in the SAS documentation:
http://support.sas.com/documentation/cdl/en/grstatgraph/65377/HTML/default/viewer.htm#p07ssfftzsass9n1x8lb94xnref5.htm
Note that GTL is only available in newer versions of SAS (9.1 onwards I believe?).