P. 1
Sqr Listing

Sqr Listing

|Views: 31|Likes:
Published by Steve Bollinger

More info:

Published by: Steve Bollinger on May 19, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

05/19/2011

pdf

text

original

!--------------------------------------------------------------------------!

! SQR_LISTING: SQR Expanded Listing
!--------------------------------------------------------------------------!
! Date: 2003-07-18
! !t"#$: Ste%e &#''inge$ - ste%e(#''inge$)g*ai'+,#*
! T"e -!$p#se #. t"is p$#g$a* is t# #!tp!t t"e ,#ntents #. an
! SQR in,'!ding a'' #. t"e /in,'!de .i'es $e,!$si%e'0+ n0
! in,'!de .i'es t"at a$e in,'!ded *#$e t"an #n,e 1i'' #n'0 (e
! added t# t"e #!tp!t #n,e+ T"e p!$p#se #. s!," #!tp!t is .#$
! de%e'#pe$s t# (e a('e t# sea$," an enti$e SQR 2in,'!ding a''
! t"e in,'!de .i'es3 .#$ st$ings4 .ie'ds4 ta('es and s!,"+
!
! T"e p$#,ed!$e p$#,ess-s#!$,e ,a''s itse'. $e,!$si%e'0 .#$
! ea," 'e%e' #. in,'!de .i'e (eing p$inted+
!
! Q!esti#ns56#**ents: ste%e(#''inge$)g*ai'+,#*
!
!--------------------------------------------------------------------------!
!
! Lega': 6#n.identia'it0 In.#$*ati#n+
!
! 6#p0$ig"t 2,3 2003 (0 Ste%e &#''inge$ '' Rig"ts Rese$%ed
! T"is *#d!'e is t"e #$igina' 1#$7 #. Ste%e &#''inge$+ It
! ,an (e ,#nside$ed 8$ee1a$e !nde$ t"e .#''#1ing ,#nditi#ns+
!
! - T"e a!t"#$9s na*e 2Ste%e &#''inge$3 and t"is 'ega' n#ti,e
! $e*ains #n an0 and a'' %e$si#ns #. t"is p$#g$a*+
! & - It *a0 (e .$ee'0 ,#pied and passed #n t# #t"e$s
! 6 - It *a0 (e *#di.ied as '#ng as an0 *#di.i,ati#ns a$e
! ,'ea$'0 identi.ied as t# a!t"#$4 date4 et,+
! D - I. 0#! 1is" 0#!$ $e%isi#ns t# (e in,#$p#$ated int# t"e p!('i,
! %e$si#n4 t"en p'ease ente$ $e%isi#ns in t"e 6"ange L#g
! and send t# t"e a!t"#$ at ste%e(#''inge$)g*ai'+,#*+
!
!--------------------------------------------------------------------------!
!
! T# R!n t"is p$#g$a*:
! 1+ edit t"e %a$ia('es :IN-;TDIR1 and :IN-;TDIR2 t# .it 0#!$ SQR
! en%i$#n*ent+
! 2+ R!n .$#* t"e ,#**and 'ine #$ .$#* a p$#g$a* t"at ,an exe,!te
! SQRs+
! 3+ Ente$ t"e na*e #. t"e SQR t# #(tain its 'isting+
! <+ T"e #!tp!t 1i'' (e in t"e '#,a' di$e,t#$0 1it" t"e sa*e na*e
! 1it" an extensi#n #. +SQ= 2SQR Expanded Listing3
!
!--------------------------------------------------------------------------!
!
!--------------------------------------------------------------------------!
! 6"ange L#g :
! Date !t"#$ 6#**ents
!--------------------------------------------------------------------------!
! 2003-07-18 Ste%e &#''inge$ Initia' Re'ease
! 200<-11-22 Ste%e &#''inge$ dded se,#nd .#'de$ .#$ in,'!de sea$,"
! 2011-02-1< Ste%e &#''inge$ 6$eated as a ,#**and 'ine %e$si#n and
! $ena*ed .$#* SQRLIST+SQR
!--------------------------------------------------------------------------!
!--------------------------------------------------------------------------!
! 6>RE -R>GR?
!--------------------------------------------------------------------------!
(egin-RE->RT

d# Init-Rep#$t
d# -$#,ess-?ain
end-RE->RT
!--------------------------------------------------------------------------!
! INIT-RE->RT
!--------------------------------------------------------------------------!
(egin-p$#,ed!$e Init-Rep#$t
inp!t :>&@N?E 9Ente$ SQR Na*e9
'et :IN-;TDIR1 A 96:BD#,sBSQRB,!st#*B9
'et :IN-;TDIR2 A 96:B-SB.s,*8<CBsD$B9
! Re*#%e an0 extensi#n
.ind 9+9 in :>&@N?E 0 /pe$i#d_'#,
i. /pe$i#d_'#, E 0
'et :>&@N?E A s!(st$2:>&@N?E4 14 /pe$i#d_'#,3
end-i.
end-p$#,ed!$e
!--------------------------------------------------------------------------!
! -R>6ESS-?IN
!--------------------------------------------------------------------------!
(egin--R>6ED;RE -$#,ess-?ain
'et :i#-e$$#$ A 9N9
'et :SQL-STTE?ENT A 9-$#,ess-?ain9
'et :sing'e_D!#te A 9999
'et :d#!('e_D!#te A 9F9
,$eate-a$$a0 na*eAin,'!des siGeA1000
.ie'dA.i'ena*e:,"a$
'et :#!t.i'ena*e A :>&@N?E HH 9+SQ=9
s"#1 9R!n 1it" $eD!est: 9 :>&@N?E 9 :#!t.i'ena*e: 9 :#!t.i'ena*e
#pen :#!t.i'ena*e as CCCC .#$-1$iting $e,#$dA2<I7J stat!sA/.i'estat
i. /.i'estat !A 0
s"#1 9KK E$$#$ KK /.i'estat A 9 /.i'estat 9 #n >!tp!t 8i'e >pen: 9
:#!t.i'ena*e
'et :i#-e$$#$ A 9>9
d# p$#,ess-i#-e$$#$
e'se
s"#1 9>!tp!t 8i'e >pen: 9 :#!t.i'ena*e
end-i.
'et :s#!$,e A :>&@N?E HH 9+SQR9
'et /$eadn!* A 1
d# p$#,ess-s#!$,e
,'#se CCCC
end--R>6ED;RE ! -$#,ess-?ain
!--------------------------------------------------------------------------!
! p$#,ess-s#!$,e
!
! T"is is t"e 1#$7"#$se #. t"is p$#g$a*+ It ,a''s itse'. $e,!$si%e'0 t#
! a''#1 .#$ *!'tip'e 'e%e's #. /in,'!de .i'es+
!--------------------------------------------------------------------------!
(egin--R>6ED;RE p$#,ess-s#!$,e
! 8#$ in,'!de .i'es *a7e a p$e.ix #. 9E 94 9EE 94 9EEE 9 et, depending #n "#1 *an0
! 'e%e's deep t"e in,'!de .i'e is+ T"is *a7es $eading t"e 'ist easie$+
d# set-'ine-p$e.ix
'et :'e%e' A edit2/$eadn!*4 9CCCC93
d# #pen-s#!$,e
i. /.i'estat$ !A 0
'et :e$$_*sg A 9KK La$ning: ,#!'d n#t #pen .i'e: 9 HH :s#!$,e HH 9 KK
/.i'estat$ A 9 HH t#_,"a$2/.i'estat$3
s"#1 :e$$_*sg
d# 1$ite-e$$-*sg
g#t# end-p,
end-i.
s"#1 9>pening SQR S#!$,e 8i'e: 9 :s#!$,e 9 Le%e': 9 :'e%e'
1"i'e 1
$ead /$eadn!* int# :'ine:I00
i. /end-.i'e A 1
($ea7
end-i.
d# 1$ite-'ine
! 6"e,7 .#$ /in,'!de .i'e t# add t# t"e 'isting
!nst$ing :'ine (0 9 9 int# :in,'!de :in,_na*e
i. :in,'!de A 9/in,'!de9
'et :in,_na*e A t$ans'ate2:in,_na*e4 :sing'e_D!#te4 9 93
'et :in,_na*e A t$ans'ate2:in,_na*e4 :d#!('e_D!#te4 9 93
!nst$ing :in,_na*e (0 9 9 int# :t"$#1_a1a0 :in,'!de_.i'ena*e
! 6"e,7 t# see i. t"is in,'!de .i'e "as a'$ead0 (een #!tp!ted+ I. s#4
! t"en ,a$$0 #n 1it"#!t #!tp!ting it again+ I. n#t4 t"en add it t# t"e
! a$$a0 and #!tp!t t"is in,'!de .i'e+
d# ,"e,7-i.-ne1-in,'!de
! T"is is a $e,!$si%e ,a'' t# t"e p$#,ed!$e t"at 0#! a$e a'$ead0 in!
! T"is a''#1s /in,'!des 1it"in /in,'!des 1it"in /in,'!des+ T"is is
! t"e t$i,7 pa$t #. t"is p$#g$a* t"at *a7es it s# si*p'e+ N# need t#
! "a%e spe,ia' ,#ding .#$ ea," 'e%e'+
i. :ne1_in,'!de A 9M9
'et /$eadn!* A /$eadn!* N 1
'et :s#!$,e A :in,'!de_.i'ena*e
d# p$#,ess-s#!$,e
end-i.
end-i.
end-1"i'e
end-p,:
,'#se /$eadn!*
'et /$eadn!* A /$eadn!* - 1
d# set-'ine-p$e.ix
end--R>6ED;RE ! p$#,ess-s#!$,e
!--------------------------------------------------------------------------!
! #pen-s#!$,e
!--------------------------------------------------------------------------!
(egin--R>6ED;RE #pen-s#!$,e
'et :#pen_s#!$,e A :s#!$,e
#pen :#pen_s#!$,e as /$eadn!* .#$-$eading $e,#$dAI00:%a$0 stat!sA/.i'estat$
i. /.i'estat$ !A 0
'et :#pen_s#!$,e A :IN-;TDIR1 HH :s#!$,e
#pen :#pen_s#!$,e as /$eadn!* .#$-$eading $e,#$dAI00:%a$0
stat!sA/.i'estat$
i. /.i'estat$ !A 0
'et :#pen_s#!$,e A :IN-;TDIR2 HH :s#!$,e
#pen :#pen_s#!$,e as /$eadn!* .#$-$eading $e,#$dAI00:%a$0
stat!sA/.i'estat$
end-i.
end-i.
end--R>6ED;RE
!--------------------------------------------------------------------------!
! 1$ite-'ine
!--------------------------------------------------------------------------!
(egin--R>6ED;RE 1$ite-'ine
'et :#!tp!t_'ine A :'ine_p$e.ix HH :'ine
1$ite CCCC .$#* :#!tp!t_'ine stat!sA/.i'estat
i. /.i'estat !A 0
s"#1 9KK E$$#$ KK /.i'estat A 9 /.i'estat 9 #n >!tp!t8i'e Line: 9 :#!tp!t_'ine
'et :i#-e$$#$ A 9L9
d# p$#,ess-i#-e$$#$
end-i.
end--R>6ED;RE
!--------------------------------------------------------------------------!
! 1$ite-e$$-*sg
!--------------------------------------------------------------------------!
(egin--R>6ED;RE 1$ite-e$$-*sg
1$ite CCCC .$#* :e$$_*sg stat!sA/.i'estat
1$ite CCCC .$#* 9 9 stat!sA/.i'estat
end--R>6ED;RE
!--------------------------------------------------------------------------!
! ,"e,7-i.-ne1-in,'!de
!--------------------------------------------------------------------------!
(egin--R>6ED;RE ,"e,7-i.-ne1-in,'!de
'et :ne1_in,'!de A 9M9
'et /i A 0
1"i'e 1
get :a$$a0_.i'ena*e .$#* in,'!des2/i3 .i'ena*e
i. :a$$a0_.i'ena*e A :in,'!de_.i'ena*e
'et :ne1_in,'!de A 9N9
($ea7
end-i.
i. :a$$a0_.i'ena*e A 99
p!t :in,'!de_.i'ena*e int# in,'!des2/i3 .i'ena*e
($ea7
end-i.
'et /i A /i N 1
end-1"i'e
end--R>6ED;RE
!--------------------------------------------------------------------------!
! p$#,ess-i#-e$$#$
!--------------------------------------------------------------------------!
(egin--R>6ED;RE p$#,ess-i#-e$$#$
e%a'!ate :i#-e$$#$
1"en A 9>9
s"#1 9>!tp!t 8i'e >pen E$$#$9
($ea7
1"en A 9L9
s"#1 9>!tp!t 8i'e L$ite E$$#$9
($ea7
end-e%a'!ate
st#p
end--R>6ED;RE
!--------------------------------------------------------------------------!
! set-'ine-p$e.ix
!--------------------------------------------------------------------------!
(egin--R>6ED;RE set-'ine-p$e.ix
i. /$eadn!* E 1
'et :'ine_p$e.ix A 'pad29 94 /$eadn!*4 9E93
e'se
'et :'ine_p$e.ix A 99
end-i.
end--R>6ED;RE

SQR !--------------------------------------------------------------------------! !--------------------------------------------------------------------------! ! CORE PROGRAM !--------------------------------------------------------------------------! begin-REPORT do Init-Report do Process-Main end-REPORT !--------------------------------------------------------------------------! ! INIT-REPORT !--------------------------------------------------------------------------! begin-procedure Init-Report input $OBJNAME 'Enter SQR Name' let $INPUTDIR1 = 'C:\Docs\SQR\custom\' let $INPUTDIR2 = 'C:\PS\fscm849\sqr\' ! Remove any extension find '. #period_loc) end-if end-procedure !--------------------------------------------------------------------------! ! PROCESS-MAIN !--------------------------------------------------------------------------! begin-PROCEDURE Process-Main .' in $OBJNAME 0 #period_loc if #period_loc > 0 let $OBJNAME = substr($OBJNAME. 1.! !--------------------------------------------------------------------------! ! Change Log : ! Date Author Comments !--------------------------------------------------------------------------! ! 2003-07-18 Steve Bollinger Initial Release ! 2004-11-22 Steve Bollinger Added second folder for include search ! 2011-02-14 Steve Bollinger Created as a command line version and ! renamed from SQRLIST.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->