|
I've got a program that I used the indentation feature on, and it's giving
me the error "Indentation Mismatch occurred". But I don't see the
problem. I'll post the code now, and perhaps someone can copy/paste and
see if they get the same thing. I've double checked my if's and do's but
to no avail... perhaps I'm losing it... it is possible.
H Dftname(Streets) Datedit(*YMD) Option(*Srcstmt:*NoDebugIo)
H Dftactgrp(*NO) Actgrp('QILE')
FStreetgarbuf e k Disk
FStreet05 if e k Disk
F Rename(Streetsr:Streets5)
F Prefix($)
FStreet03 if e k Disk
F Rename(Streetsr:Streets3)
F Prefix(#)
FCgararea o e k Disk Usropn
FWpuschedleo e k Disk Usropn
FList88 o f 132 Printer
F Oflind(*InOf)
? //
D tabtm s 3 Dim(12) Ctdata Perrcd(1)
D tabac s 2 Dim(12) Alt(Tabtm)
? //
D f1t s 34 Varying
? //
D pos s 2 0
D end_pos s 2 0
D result s 34 Varying
D len s 2 0
D f1_Key s 30
D f1_Work s 30
D counter s 4 0
D rec_Count s 4 0
D totals s 40
D charDate s 8
D strnm_Trimmed s 30
D strnm_100a s 100
D strnm_100b s 100
D strnm_100c s 100
D Cmd s 300A Inz
//-Define constant
fields--------------------------------------------------------
D area1 c const('AREA 1')
D area2 c const('AREA 2')
D area3 c const('AREA 3')
D area4 c const('AREA 4')
D area5 c const('AREA 5')
D dontdo c const('DON''T DO')
D residents c const('(Residents')
D civic_no c const('(Civic')
//--------------------------------------------------
// Procedure name: GetDate
// Purpose: Reformat the date
// Returns:
//--------------------------------------------------
D GetDate PR LIKE(charDate)
D inDate LIKE(Date1)
//--------------------------------------------------
//--------------------------------------------------
// Procedure name: Get_Comments
// Purpose: Gets the street commments
// Returns: Street comments
//--------------------------------------------------
D Get_Comments PR 40A
D inStreet 300A
//--------------------------------------------------
// Procedure name: Qcmdexc
// Purpose: To allow the running of CL commands
// Returns:
// Parameter: Cmd => Command to run
// Parameter: CmdLen => Length of command to run
//--------------------------------------------------
D QCmdExc PR EXTPGM('QCMDEXC')
D Cmd 3000A Const Options(*VARSIZE)
D CmdLen 15P 5 Const
D Cmddbcs 3A Const Options(*NOPASS)
//--------------------------------------------------
? //
/FREE
*InOf = *On;
// Clear out the existing data that may be in the files
Cmd = 'CLRPFM FILE(WPUSCHEDLE)';
CallP(E) QCmdExc(Cmd:%Len(Cmd));
Cmd = 'CLRPFM FILE(CGARAREA)';
CallP(E) QCmdExc(Cmd:%Len(Cmd));
Open Wpuschedle;
Open Cgararea;
// Loop thru all the records in the file
Read Streetgarb;
Dow Not %Eof(Streetgarb);
f1_Work = strnm;
rec_Count = rec_Count + 1;
// Check for '- P' and remove everything after
pos = 0;
pos = %Scan( '- P' : f1_Work:1 );
If pos > 1;
f1t = %trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '- P' and remove everything after
pos = 0;
pos = %Scan( '- P' : f1_Work:1 );
If pos > 1;
f1t = %trim(f1_Work);
len = (pos - 1);
result = %subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '- p' and remove everything after
pos = 0;
pos = %Scan( '- p ' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '-P' and remove everything after
pos = 0;
pos = %Scan( '-P' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '- ped' and remove everything after
pos = 0;
pos = %Scan( '- ped' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '- (p' and remove everything after
pos = 0;
pos = %Scan( '- (p' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '- (pe' and remove everything after
pos = 0;
pos = %Scan( '- (ped' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '(p' and remove everything after
pos = 0;
pos = %Scan( ' (p' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '(M' and remove all after
pos = 0;
pos = %Scan( '(M' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '(A' and remove all after
pos = 0;
pos = %Scan( '(A' : f1_Work:1 );
If pos > 1;
f1t = %trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '- (' and remove all after
pos = 0;
pos = %Scan( '- (' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for '(G' and remove everything after
pos = 0;
pos = %Scan( '(G' : f1_Work:1 );
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// Check for ' (' and remove everything after
pos = 0;
pos = %Scan( ' (' : f1_Work:1);
If pos > 1;
f1t = %Trim(f1_Work);
len = (pos - 1);
result = %Subst(f1_Work:1:len);
f1_Work = result;
EndIf;
// See what we can do about getting a street number for it
f1_Key = f1_Work;
Chain f1_Key Streets5;
If %Found(Street05);
cgstreet# = $cstret;
cgstseq# = 0;
cgstname = $cstact;
cgstext = *blanks;
cgcivics = *blanks;
cgcivice = *blanks;
cgstrcom = Get_Comments(strnm);
cgsp05a = Stid;
If area <> dontdo;
cggarbarea = %subst(area:6:1);
Else;
cggarbarea = *Blanks;
EndIf;
Write(E) Cgararear;
Dow %Error;
cgstseq# += 1;
Write(E) Cgararear;
EndDo;
pos = 0;
pos = %Scan(civic_no:strnm);
If pos > 1;
strnm_100a = %Subst(strnm:1:100);
strnm_100b = %Subst(strnm:101:100);
strnm_100c = %Subst(strnm:201:100);
If *Inof;
Except Header;
EndIf;
Except CivicDet;
EndIf;
If area <> dontdo;
Exsr Sched;
EndIf;
Else;
Chain f1_Key Streets3;
If %Found(Street03);
cgstreet# = #cstret;
cgstseq# = 0;
cgstname = #cstact;
cgstext = *blanks;
cgcivics = *blanks;
cgcivice = *blanks;
cgstrcom = Get_Comments(strnm);
cgsp05a = Stid;
If area <> dontdo;
cggarbarea = %subst(area:6:1);
Else;
cggarbarea = *Blanks;
EndIf;
Write(E) Cgararear;
Dow %Error;
cgstseq# += 1;
Write(E) Cgararear;
EndDo;
pos = 0;
pos = %Scan(civic_no:strnm);
If pos > 1;
strnm_100a = %Subst(strnm:1:100);
strnm_100b = %Subst(strnm:101:100);
strnm_100c = %Subst(strnm:201:100);
If *Inof;
Except Header;
EndIf;
Except CivicDet;
EndIf;
If area <> dontdo;
Exsr Sched;
EndIf;
Else;
counter = counter + 1;
If *InOf;
Except Header;
*InOf = *Off;
EndIf;
strnm_Trimmed = %Subst(strnm:1:30);
Except Detail;
EndIf;
EndIf;
Clear Cgararear;
f1_Key = *Blanks;
f1_Work = *Blanks;
Read Streetgarb;
EndDo;
Totals = %Char(counter) + ' ' + 'Records-
not found on STREETS file.';
If *Inof;
Except Header;
EndIf;
Except Total_Line;
Close Wpuschedle;
Close Cgararea;
*InLr = *On;
//---------------------------------------------------------------------
// Build pickup schedule file
BegSr Sched;
Wpuyear = 2005;
Wpuarea = %subst(area:6:1);
Wpustr# = Cgstreet#;
Wpucnt11 = 1;
Wpuap#11 = 1;
Wpumax11 = 75;
Wpucnt12 = 1;
Wpuap#12 = 1;
Wpumax12 = 75;
Wpucnt13 = 1;
Wpuap#13 = 1;
Wpumax13 = 75;
Wpucnt21 = 1;
Wpuap#21 = 1;
Wpumax21 = 75;
Wpucnt22 = 1;
Wpuap#22 = 1;
Wpumax22 = 75;
Wpucnt23 = 1;
Wpuap#23 = 1;
Wpumax23 = 75;
Wpucnt31 = 1;
Wpuap#31 = 1;
Wpumax31 = 75;
Wpucnt32 = 1;
Wpuap#32 = 1;
Wpumax32 = 75;
Wpucnt33 = 1;
Wpuap#33 = 1;
Wpumax33 = 75;
Wpusp30a = *blanks;
Wpusp20a = *blanks;
Wpusp10a = *blanks;
Wpusp05a = Stid;
Wpusp01a = *blanks;
Wpusp92s = 0;
Wpusp72s = 0;
Wpusp52s = 0;
Wpusp90s = 0;
Wpusp70s = 0;
Wpusp50s = 0;
Wpusp30s = 0;
Wpusp10s = 0;
//
Select;
When area = area1;
Wpufrdte10 = 20050621;
Wputodte10 = 20050630;
charDate = GetDate(Date1);
Wpupudte11 = %Int(charDate);
charDate = GetDate(Date2);
Wpupudte12 = %Int(charDate);
Wpupudte13 = 0;
Wpufrdte20 = 20050801;
Wputodte20 = 20050805;
charDate = GetDate(Date3);
Wpupudte21 = %Int(charDate);
Wpupudte22 = 0;
Wpupudte23 = 0;
Wpufrdte30 = 20050906;
Wputodte30 = 20050909;
charDate = GetDate(Date4);
Wpupudte31 = %Int(charDate);
Wpupudte32 = 0;
Wpupudte33 = 0;
//
When area = area2;
Wpufrdte10 = 20050606;
Wputodte10 = 20050617;
charDate = GetDate(Date1);
Wpupudte11 = %Int(charDate);
charDate = GetDate(Date2);
Wpupudte12 = %Int(charDate);
Wpupudte13 = 0;
Wpufrdte20 = 20050725;
Wputodte20 = 20050729;
charDate = GetDate(Date3);
Wpupudte21 = %Int(charDate);
Wpupudte22 = 0;
Wpupudte23 = 0;
Wpufrdte30 = 20050829;
Wputodte30 = 20050902;
charDate = GetDate(Date4);
Wpupudte31 = %Int(charDate);
Wpupudte32 = 0;
Wpupudte33 = 0;
//
When area = area3;
Wpufrdte10 = 20050524;
Wputodte10 = 20050603;
charDate = GetDate(Date1);
Wpupudte11 = %Int(charDate);
charDate = GetDate(Date2);
Wpupudte12 = %Int(charDate);
Wpupudte13 = 0;
Wpufrdte20 = 20050718;
Wputodte20 = 20050722;
charDate = GetDate(Date3);
Wpupudte21 = %Int(charDate);
Wpupudte22 = 0;
Wpupudte23 = 0;
Wpufrdte30 = 20050822;
Wputodte30 = 20050826;
charDate = GetDate(Date4);
Wpupudte31 = %Int(charDate);
Wpupudte32 = 0;
Wpupudte33 = 0;
//
When area = area4;
Wpufrdte10 = 20050509;
Wputodte10 = 20050520;
charDate = GetDate(Date1);
Wpupudte11 = %Int(charDate);
charDate = GetDate(Date2);
Wpupudte12 = %Int(charDate);
Wpupudte13 = 0;
Wpufrdte20 = 20050712;
Wputodte20 = 20050715;
charDate = GetDate(Date3);
Wpupudte21 = %Int(charDate);
Wpupudte22 = 0;
Wpupudte23 = 0;
Wpufrdte30 = 20050815;
Wputodte30 = 20050819;
charDate = GetDate(Date4);
Wpupudte31 = %Int(charDate);
Wpupudte32 = 0;
Wpupudte33 = 0;
//
When area = area5;
Wpufrdte10 = 20050426;
Wputodte10 = 20050506;
charDate = GetDate(Date1);
Wpupudte11 = %Int(charDate);
charDate = GetDate(Date2);
Wpupudte12 = %Int(charDate);
Wpupudte13 = 0;
Wpufrdte20 = 20050704;
Wputodte20 = 20050708;
charDate = GetDate(Date3);
Wpupudte21 = %Int(charDate);
Wpupudte22 = 0;
Wpupudte23 = 0;
Wpufrdte30 = 20050808;
Wputodte30 = 20050812;
charDate = GetDate(Date4);
Wpupudte31 = %Int(charDate);
Wpupudte32 = 0;
Wpupudte33 = 0;
//
EndSl;
// write bulk record
Wpgtype = 'B';
Write(e) Wpuschedlr;
// write metal record
Wpgtype = 'M';
Wpumax11 = 50;
Wpumax12 = 50;
Wpumax13 = 50;
Wpumax21 = 50;
Wpumax22 = 50;
Wpumax23 = 50;
Wpumax31 = 50;
Wpumax32 = 50;
Wpumax33 = 50;
Write(e) Wpuschedlr;
EndSr;
//---------------------------------------------------------------------
/END-FREE
OList88 e Header 2 1
O 55 'Streets not found on
STREE-
O TS file'
//
O e Header 1
O 5 'Rec #'
O 19 'Actual Field'
O 54 'Key Value'
//
O e Header 1
O 5 '_____'
O 42
'__________________________-
O ________'
O 75
'__________________________-
O ____'
//
O e Detail 1
O rec_Count k 6
O strnm_Trimmed 42
O f1_Work 75
//
O e CivicDet 1
O 'Civics to be entered
for'
O +1 'street: '
O e CivicDet 1
O strnm_100a 130
O e CivicDet 1
O strnm_100b 130
O e CivicDet 1
O strnm_100c 130
//
O e Total_Line 2
O 6 'Total:'
O Totals 40
//--------------------------------------------------
// Procedure name: GetDate
// Purpose: Reformat the date
// Returns:
//--------------------------------------------------
P GetDate B
D GetDate PI LIKE(charDate)
D inDate LIKE(Date1)
// Local fields
D charMonth s 3
D charDay s 2
D retField S LIKE(charDate)
/FREE
charMonth = %Subst(inDate:1:3);
/END-FREE
C charMonth LookUp tabtm tabac
99
/FREE
charDay = '00';
EvalR charDay = %trim(%subst(inDate:5:2));
retField = '2005' + tabac + charDay;
Return retField;
/END-FREE
P GetDate E
//--------------------------------------------------
// Procedure name: GetDate
// Purpose: Reformat the date
// Returns:
//--------------------------------------------------
P Get_Comments B
D Get_Comments PI 40A
D inStreet 300A
// Local fields
D retField S 40A
/FREE
pos = 0;
pos = %Scan(residents:inStreet);
If pos > 1;
end_pos = %Scan(')':inStreet:pos);
result = %Subst(inStreet:pos+1:end_pos-(pos+1));
retField = %Trim(result);
Else;
retField = *Blanks;
EndIf;
Return retField;
/END-FREE
P Get_Comments E
**
JAN01
FEB02
MAR03
APR04
MAY05
JUN06
JUL07
AUG08
SEP09
OCT10
NOV11
DEC12
And the indent list with the problem is as follows for the section:
If pos > 1;
end_pos = %Scan(')':inStreet:pos);
result = %Subst(inStreet:pos+1:end_pos-(pos+1));
retField = %Trim(result);
Else;
| retField = *Blanks;
EndIf;
The If doesn't line up with anything....
TIA,
Ron Power
Programmer
Information Services
City Of St. John's, NL
P.O. Box 908
St. John's, NL
A1C 5M2
Tel: 709-576-8132
Email: rpower@xxxxxxxxxx
Website: http://www.stjohns.ca/
___________________________________________________________________________
Success is going from failure to failure without a loss of enthusiasm. -
Sir Winston Churchill
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.