if you skip one the output will be truncated.
things are a bit more complicated ...
that' s why it is IMPROPER to use
EXECIO * DISKWalways use the count when writing from a STEM
and use the * only when writing from the stack
run this and see Yourself why
( just allocate a fb 80 sequential file and use that instead of ENRICO.TEST.EXECIO )
****** ***************************** Top of Data ******************************
000001 /* REXX */
000002
000003 Trace "O"
000004 Signal on novalue name novalue
000005
000006 do i = 1 to 10
000007 stem.i = "xyz" || right(i,2,"0")
000008 end
000009
000010 Address TSO
000011 "ALLOC FI(OUT) DS('ENRICO.TEST.EXECIO') SHR REUS"
000012
000013 head.1 = "- - - - - - - - - - - - - - - - - - - "
000014 head.2 = "EXECIO * DISKW OUT (STEM STEM. "
000015 head.3 = "- with stem.5 = 'xyz05' "
000016 "EXECIO 3 DISKW OUT (STEM HEAD. "
000017 "EXECIO * DISKW OUT (STEM STEM. "
000018 head.1 = "- - - - - - - - - - - - - - - - - - - "
000019 head.2 = "EXECIO 10 DISKW OUT (STEM STEM. "
000020 head.3 = "- with stem.5 = 'xyz05' "
000021 "EXECIO 3 DISKW OUT (STEM HEAD. "
000022 "EXECIO 10 DISKW OUT (STEM STEM. "
000023
000024 stem.5 = ""
000025 head.1 = "- - - - - - - - - - - - - - - - - - - "
000026 head.2 = "EXECIO * DISKW OUT (STEM STEM. "
000027 head.3 = "- with stem.5 = '' "
000028 "EXECIO 3 DISKW OUT (STEM HEAD. "
000029 "EXECIO * DISKW OUT (STEM STEM. "
000030 head.1 = "- - - - - - - - - - - - - - - - - - - "
000031 head.2 = "EXECIO 10 DISKW OUT (STEM STEM. "
000032 head.3 = "- with stem.5 = '' "
000033 "EXECIO 3 DISKW OUT (STEM HEAD. "
000034 "EXECIO 10 DISKW OUT (STEM STEM. "
000035
000036 drop stem.5
000037 head.1 = "- - - - - - - - - - - - - - - - - - - "
000038 head.2 = "EXECIO * DISKW OUT (STEM STEM. "
000039 head.3 = "- with drop.5 "
000040 "EXECIO 3 DISKW OUT (STEM HEAD. "
000041 "EXECIO * DISKW OUT (STEM STEM. "
000042 head.1 = "- - - - - - - - - - - - - - - - - - - "
000043 head.2 = "EXECIO 10 DISKW OUT (STEM STEM. "
000044 head.3 = "- with drop.5 "
000045 "EXECIO 3 DISKW OUT (STEM HEAD. "
000046 "EXECIO 10 DISKW OUT (STEM STEM. FINIS"
000047
000048 exit
000049
000050 novalue:
000051 say "** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
000052 say "** "
000053 say "** novalue trapped at line" right(sigl,5)
000054 say "** "
000055 say "** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
000056 exit
000057
000058 /* */
000059 logic_error:
000060 say "** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
000061 say "** "
000062 say "** logic error at line " right(sigl,5)
000063 say "** "
000064 say "** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"
000065 exit
****** **************************** Bottom of Data ****************************
if You cannot run the sample Yourself here is the result
EDIT ENRICO.TEST.EXECIO Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 - - - - - - - - - - - - - - - - - - -
000002 EXECIO * DISKW OUT (STEM STEM.
000003 - with stem.5 = 'xyz05'
000004 xyz01
000005 xyz02
000006 xyz03
000007 xyz04
000008 xyz05
000009 xyz06
000010 xyz07
000011 xyz08
000012 xyz09
000013 xyz10
000014 - - - - - - - - - - - - - - - - - - -
000015 EXECIO 10 DISKW OUT (STEM STEM.
000016 - with stem.5 = 'xyz05'
000017 xyz01
000018 xyz02
000019 xyz03
000020 xyz04
000021 xyz05
000022 xyz06
000023 xyz07
000024 xyz08
000025 xyz09
000026 xyz10
000027 - - - - - - - - - - - - - - - - - - -
000028 EXECIO * DISKW OUT (STEM STEM.
000029 - with stem.5 = ''
000030 xyz01
000031 xyz02
000032 xyz03
000033 xyz04
000034 - - - - - - - - - - - - - - - - - - -
000035 EXECIO 10 DISKW OUT (STEM STEM.
000036 - with stem.5 = ''
000037 xyz01
000038 xyz02
000039 xyz03
000040 xyz04
000041
000042 xyz06
000043 xyz07
000044 xyz08
000045 xyz09
000046 xyz10
000047 - - - - - - - - - - - - - - - - - - -
000048 EXECIO * DISKW OUT (STEM STEM.
000049 - with drop.5
000050 xyz01
000051 xyz02
000052 xyz03
000053 xyz04
000054 - - - - - - - - - - - - - - - - - - -
000055 EXECIO 10 DISKW OUT (STEM STEM.
000056 - with drop.5
000057 xyz01
000058 xyz02
000059 xyz03
000060 xyz04
000061 STEM.5
000062 xyz06
000063 xyz07
000064 xyz08
000065 xyz09
000066 xyz10
****** **************************** Bottom of Data ****************************
anyway dropping a stem entry without changing stem.0
or/and losing track of the valid stem entries is IMO a logic/coding error