home *** CD-ROM | disk | FTP | other *** search
- /* SIMCVT EXEC. Original by Peter Jones Maint@Uqam.Bitnet
- Rewritten by (Robocop). 03.25.90. <Vivanco@Utfsm.Bitnet> Disca. */
- trace 'O'
- address ''
- arg yip
- yip=strip(yip)
- if yip='?'|yip='HELP' then signal help
- signal on syntax
- inp='SIMIBM IDX'
- out='SIMIBM LISTING'
- h='DMSSIM'
- 'ESTATE 'inp
- if rc^=0 then do
- say h'028E Input file "'inp'" doesn''t exist.'
- exit rc
- end
- 'MAKEBUF'
- nbuf=rc
- 'LISTF 'inp' * (LIFO ALL NOH'
- pull . . fm . len .
- 'DROPBUF 'nbuf
- fm=strip(fm)
- inp=inp fm
- len=strip(len)
- if len>132 then do
- say h'001E Input file "'inp'" is in packed format.'
- exit 1
- end
- push''
- pull lastfs lastdir dir
- say'Select your output disk: A, B, C, ... Z. Default is "A".'
- parse upper external mod .
- mod=left(strip(mod),1)
- if mod=''|pos(mod,'ABCDEFGHIJKLMNOPQRSTUVWXYZ')=0 then mod='A'
- 'MAKEBUF'
- nbuf=rc
- 'QUERY DISK R/W (LIFO'
- if queued()>1 then do queued()-1
- pull 12 $ 13
- dir=dir $
- end
- 'DROPBUF 'nbuf
- if find(dir,mod)=0 then do
- say h'036W Disk "'mod'" isn''t in write access mode.'
- exit 36
- end
- out=out mod
- resp=''
- 'ESTATE 'out
- if rc=0 then do
- say h'00IW Output file "'out'" already exists. Select your option:'
- say'A=Generate append ; R=Replace existing file ; other key=exit.'
- parse upper external resp .
- resp=left(strip(resp),1)
- if resp='R' then do
- 'ERASE 'out
- if rc^=0 then do
- say h'028E Output file "'out'" couldn''t be erased.'
- exit rc
- end
- end
- else if resp^='A' then exit
- 'FINIS 'out
- end
- say h'001I Output file "'out'" is being generated now.'
- input='EXECIO 1 DISKR 'inp
- output='EXECIO 1 DISKW 'out
- outp4='EXECIO 4 DISKW 'out' (NOTYPE STEM LIN.'
- tic='1WSMR-SIMTEL20.ARMY.MIL PUBLIC DOMAIN LISTING AS OF' 'DATE'('O')
- if resp^='A' then output' 1 V 132 (NOTYPE VAR TIC'
- else output' (NOTYPE VAR TIC'
- lin.4='0NOTE: Type B is Binary; Type A is ASCII'
- output=output' (NOTYPE VAR LIN.4'
- output
- lin.2=' Filename Type Length Date Description'
- lin.3=' 'copies('=',46)
- input' 1 (STRIP VAR SIMREC'
- input=input' (STRIP VAR SIMREC'
- do while rc=0
- parse var simrec '"'simfs'","'simdir'","'simflnm'",',
- simrev','simlngth','simbits','simdt',"'simdescr'"'
- if simbits=8 then simbits='B'
- else simbits='A'
- lin.4=' 'left(simflnm,14)||simbits||right(simlngth,7),
- right(simdt,7) ' 'simdescr
- if simfs simdir^=lastfs lastdir then do
- lin.1='0Directory 'simfs||simdir
- outp4
- lastfs=simfs
- lastdir=simdir
- end
- else output
- if rc=0 then input
- end
- if rc=2 then do
- say h'002I Output file "'out'" has been generated.'
- 'FINIS 'out
- 'FINIS 'inp
- rcc=0
- if yip='ERASE' then do
- 'ERASE 'inp
- rcc=rc
- if rc^=0 then say h'028E Input file "'inp'" couldn''t be erased.'
- end
- end
- else do
- rcc=rc
- parse source . . fn ft fm .
- say h||right(rc,3,0)' Unexpected return code rc 'rcc,
- 'in file named "'source_id'" near line' sigl'.'
- 'FINIS 'inp
- 'FINIS 'out
- say'Explanation is: 'errortext(rcc)
- end
- exit rcc
- Syntax:
- say'Syntax error rc= 'rc' in line 'sigl'. Line is:'
- say sourceline(sigl)
- say'Explanations is:'
- say errortext(rc)
- exit rc
- Help:
- say'Simcvt exec uses file "simibm idx" to generate "simibm listing".'
- say'@Copyright 1990 by Peter Jones <Maint@Uqam.Bitnet>.'
- say'Rewritten by C. Valderrama C. <Vivanco@Utfsm.Bitnet>. 1991.'
- say
- say'Simcvt ? Calls this brief explanation.'
- say'Simcvt ERASE',
- ' Erases source file "simibm idx" if process finishs correctly.'
- say
- say'If "simibm listing" already exists, simcvt will ask you what do'
- say'you want to do before continue.'
- say'Use "Arcutil module" available from Listserv@Rpiecs to convert',
- '"simibm arc"'
- say'into "simibm idx": Arcutil unarc simibm arc (rep e m simibm idx'
- say' or use: Arcutil uud simibm arc (eb'
- exit 100
-