host - Dataset (Sysout) read error after COBOL program execution -
in rexx program, cobol program invoked , it's sysout captured using temporary dataset allocation (tso alloc) , using execio read. works without issues.
one of our users (using different machine) reported issue @ execio read.
irx0562e abnormal completion of data management macro. irx0565e sg0 ,$logon ,3420,d,sysout ,get ,wrng.len.record,0000003500000 0,qsam. iec020i 001-4,sg0,$logon,sysout,3420,bws858, iec020i sys15089.t170858.ra000.sg0.r0278041 iec020i dcb eropt=abe or invalid code, and/or no synad exit specified irx0250e system abend code 001, reason code 00000004. irx0255e abend in host command execio or address environment routine mvs.
i found issue occured when cobol program has outputs on sysout. recreate similar situation in z/os system specifying 'vb' attribute in tso allocation. in case, allocated dataset not viewable in ispf. following error message shown, when trying view in ispf.
'i/o error occurred reading edit data'
if corrupted data allocated using shared/old mode problem resolved. kind of issue occurs new allocation , during cobol program execution.
after cobol program execution, further shr/old mode allocation corrected issue. ideas on went wrong here?
for test version, use catalogued file follows. following allocation of sysout, before cobol program execution follows. see issue occurs when change record format 'vb'(which re-creation of same error reported user in zos machine).
if (existsdsn(tmpds)) address tso, /* here works */ "alloc ds('"tmpds"') f(sysout) shr reuse" end else address tso /* ds creation error here */ "alloc ds('"tmpds"') f(sysout) new dsorg(ps)", "blksize(121) space(5,15) tracks recfm(f b a) dir(0)" end
please note catalogued sysout dataset not readable in ispf browse mode.
following output of cobol program mentioned bill, first record appears twice(i.e, total 4 message lines) in sysout.
0000000121 4ffffffffff 00000000121 ' ` expected message text 4070007004 00d0009000
ok, here manuals of situation:
enterprise cobol programming guide
by default, dfsort diagnostic messages sent sysout data set. if want change default, use msgddn parameter of dfsort option control card or use sort-message special register.
enterprise cobol language reference
you can use sort-message special register specify ddname of data set sort utility should use in place of sysout data set. ddname specified in sort-message equivalent name specified on ’msgddn=’ control statement in sort control file.
dfsort application programming guide (my emphasis)
//sysout dd
identifies dfsort message data set. default ddname sysout, can specify alternate ddname message data set using msgddn installation or run-time option. supply dd statement message data set if catalogued procedure not used. (if invoking dfsort cobol program , using ddname sysout message data set, use of display in cobol program can produce uncertain printing results.)
dfsort uses recfm=fba, lrecl=121, , specified blksize message data set. if blksize specify not multiple of 121, dfsort uses blksize=121. if not specify blksize, dfsort selects block size directed sdbmsg installation option (see z/os dfsort installation , customization). if use temporary or permanent message data set, best specify disposition of mod ensure see messages , control statements in message data set.
and:
msgddn
msgddn=ddname
temporarily overrides msgddn installation option, specifies alternate ddname message data set. msgddn must in effect if:
v a program invokes dfsort uses sysout (for instance, cobol uses sysout) , not want dfsort messages intermixed program messages.
v e15 , e35 routines written in cobol , not want dfsort messages intermixed program messages.
v program invokes dfsort more once , want separate messages each invocation of dfsort.
the ddname can 1- through 8- character name must unique within job step; not use name used dfsort (for example, sortin). if ddname specified not available @ run-time, sysout used instead. details on use of message data set, see z/os dfsort messages, codes , diagnosis guide note: msgddn processed if passed on option control statement in extended parameter list or in dfsparm.
what have done, despite advice in manuals, mix sysout output cobol , dfsort (indeed multiple invocations of dfsort). have done whilst directing sysout sequential dataset, different characteristics dfsort uses. since dfsort output messages, dataset guaranteed corrupted if cobol program used @ least on display in run.
if had directed sysout dd sysout= (spool) dataset @ point during testing (i'd guess close 100% of people way) you'd have noticed mixed output on sysout dataset step. i'm not sure how have looked (having never done this, or known done) have been able @ least identify source of multiple use (the same cobol program, doing own displays, , doing multiple internal sorts).
you have solved problem using dfsort's msgdd= modify default output dd (sysout).
it worth noting can change name of dd used cobol display, default (sysout) else, compiler option outdd(somedd).
language environment also uses sysout default, can use run-time option msgfile modify (le run-time options can set in various ways, consult language environment documentation (i find easiest //ceedopt dd
in jcl batch program).
ensuring files allocated 1 execution of program within rexx program de-allocated afterwards, , datasetnames not re-used watch every time. ensure check rc, whenever can set rc. don't specify options on statements not required.
here's data shown before pasted question, program provided:
0000000121 4ffffffffff 00000000121 ' ` expected message text 4070007004 00d0009000
second attempt:
expected message text
44 00
i'm not sure "expected message text" means, nor "the first record appears twice", nor "total 4 message lines".
the data isn't lined up. in question, corrected 0000000121 part, not other record.
ignoring "expected message text" showing 2 data-records, in "hexadecimal" format (set hex on in sdsf if using browse spool output).
the first blank may artifact of sdsf. when first @ spool file, if @ cols, you'll see data starts @ column two. if move screen left, you'll see first column, not data.
so, guess have 2 records. 1 10 zoned-decimal digits (or "character") , 1 not same.
the first record looks fixed-length record, of 10 bytes. second looks live variable-length record. in fact, block of variable-length data.
this file will, absolute certainty, give "wrong length record".
however, given that, there not quite right show. think have done not copy trailing blanks.
we know have lrecl of 121, , fixed-length records, means records 121 bytes long, yet show 10 bytes. ok, written overriding length 10.
however, variable-lenght data, goes this
x'007d' = block length, 125 bytes, first half of block descriptor word (bdw) including length (four) of bdw. x'0000' = second half of bdw x'0079' = record length, 121 bytes, first half of record descriptor word (rdw) including length (four) of rdw. 121 bytes of data, show x'40'. let's assume 121 bytes of space.
let's therefore go , assumed fixed-length record 121 bytes trailing blanks. seeing in "answer" first "line" not aligned, can assume made adjustment leading blank, , on second record.
it not yet clear where, file "a mix". have 1 fixed-length record, 1 variable-length block (containing 1 record) need paste see once have selected spool file output in hex mode. way left right of screen. copy/paste, not screenprint.
which think correct line? blanks, or 0000000121?
ok, still not lot work on :-)
your problem tmpds
. can't see content of that, problem.
it has name looks temporary, content making things more permanent expecting.
at time user gets failure on system , getting running of cobol program, file, dataset exact name, exists on system. cobol going blithely clobber it, fba 121. if file being used other cobol clobbers with, exact situation detail.
there multiple possibilities how has happened. using same name in different rexx programs easiest. prefixing tso-userid may partly help, need either let system decide on name or generate such cannot duplicate.
can't of without seeing code. 99.3% sure, until tell me otherwise :-)
here's short program can use read file , see in there:
id division. program-id. stob26. environment division. input-output section. file-control. select in-file assign infile file status w-file-status. data division. file section. fd in-file record varying depending on w-rec-length recording mode u. 01 in-rec. 05 filler occurs 1 32760 times depending on w-rec-length pic x. working-storage section. 01 w-file-status pic xx. 88 file-status-good value "00". 88 file-status-ok-for-input value "00" "10". 88 end-of-file value "10". 01 w-rec-length pic 9(8) comp. procedure division. display 'start of program' open input in-file if not file-status-good display 'open failed' '>' w-file-status '<' call 'fred' end-if perform until end-of-file read in-file if not file-status-ok-for-input display "read failed" '>' w-file-status '<' call 'fred' end-if display 'record length is>' w-rec-length '<' display 'data is>' in-rec '<' end-perform close in-file if not file-status-good display 'close failed' '>' w-file-status '<' call 'fred' end-if display 'end of program' goback .
the jcl simple, , can based on this:
//runit exec pgm=vara,time=(,2) //steplib dd dsn=loadlibrary,disp=shr //sysout dd sysout=* //infile dd dsn=yourbusteddsn,lrecl=32760,recfm=u,disp=shr
Comments
Post a Comment