|
This is ugly but I tried to get a start maybe someone else will be able to
finish it..
finput if f 112 disk usropn
f extfile(File)
f extmbr(Member)
f* @Doc
f* This program will read through a source member and when it find the
above Keyword
f* will print all following source lines until it finds the end
keyword
f* @eDoc
f*
fqprint o f 132 printer oflind(*inof)
d* @Doc PROCEDURE SPECIFICATION
d jsr012 pr EXTPGM('JSR012')
d file 21a
d member 10a
d
d jsr012 pi
d file 21a
d member 10a
d pos s 5u 0
D source s 100a
d* @eDoc
D DS
D SRCSEQ 1 6S 2
D SRCDAT 7 12S 0
D SRCDTA 13 112A
D
D up C 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
D lo C 'abcdefghijklmnopqrstuvwxyz'
Iinput NS
I 1 6 2SRCSEQ
I 7 12 0SRCDAT
I 13 112 SRCDTA
c
c eval file = %xlate(lo:up:file)
c eval member = %xlate(lo:up:Member)
c open input
c *start setll input
c except head
c
c dow not %eof
c
c read input
c eval pos = %scan('@DOC':%xlate(lo:up:srcdta))
c if pos<> 0
c
c exsr check_Pos
c READ input
c
c DOW (%scan('@EDOC':%xlate(lo:up:srcdta))) =
0
c
c exsr check_pos
c
c READ input
c
c IF %eof
c return
c ENDIF
c
c IF *inof = *on
c EXCEPT Head
c ENDIF
c
c ENDDO
c
c IF (%scan('@EDOC':%xlate(lo:up:srcdta))) >
0
c
c exsr check_pos
c EXCEPT break
c
c endif
c
c ENDIF
c
c IF *inof = *on
c EXCEPT Head
c
c ENDIF
c
c ENDDO
c
c eval *inlr = '1'
c
c check_Pos begsr
c eval pos = %scan('*':srcdta)
c IF pos = 0
c eval pos = %scan('//':srcdta)
c ENDIF
c
c IF pos = 0
c eval pos = 6
c ENDIF
c
c eval source = %subst(srcdta:pos)
c EXCEPT out
c* READ input
c endsr
c
oQPRINT e Head 1 3
o 77 'Comment Documentation'
o e Head 1
o file 77
o e Head 2
o member 71
o e out 1
o srcseq 8 ' 0. '
o source 110a
o e break 1 1
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.