Hello,
unfortunately, I have not much time to examine the program from 2001,
but as I told you already, this ASSEMBLER program was only a first test,
just to see if the corrupted PDS could be read at all - which turned out
to be the case.
The final repair was done with a C program. The C program reads the
BLOCKS of
the PDS through the BSAMIO ASSEMBLER subprogram and checks the contents
of the blocks, if they are valid. And, by watching the EOF indications
while reading
(see EODAD), it recognizes the start of a new member.
The unpacking of the blocks (into records), the writing of the records
to the final
target PDS, was all done using C logic, because it is much more comfortable
(for me).
For example:
/************************************************/
/* Membernummer eins hoch für das nächste */
/************************************************/
membernr ++;
if (membernr == 1)
{
printf ("%d Directory-Blocks wurden überlesen\n",
blocknr);
}
sprintf (outfilename, "%s(M%07d)", parmvalues [0], membernr);
direct = 0;
you can see, how the member names of the target PDS are built;
parmvalues [0] is the DDName of the target PDS, and membernr is the number
of the member, which is increased by one for every new member; the
membername
is built like this: M0000001 and so on, see the pattern in the sprintf
above.
So in the final repair program there are no text messages which are
placed in
the output; the text messages go to SYSPRINT via printf, while the
output to the
target PDS goes to another DDName.
I show you the BSAMIO ASSEMBLE subprogram, too:
BSAMIO CSECT
#COPYR BSAMIO
*
*************************************************************
* ANFANGSMAKRO INKL. LINKAGE-KONVENTIONEN
*************************************************************
*
#BEGIN
*
LR R4,R1
*
AVAMODE SET24
*
LM R2,R3,0(R4)
*
CH R2,=H'0' OPEN
BE WORK0
*
CH R2,=H'1' READ
BE WORK1
*
CH R2,=H'2' CLOSE
BE WORK2
*
CH R2,=H'3' NOTE
BE WORK3
*
CH R2,=H'4' POINT
BE WORK4
*
AVAMODE SET31
#RET RC=16
*
*
*************************************************************
* EINGABEDATEI OEFFNEN.
*************************************************************
*
WORK0 DS 0H
*
OPEN (EING,(INPUT))
*
AVAMODE SET31
#RET RC=0
*
*
*************************************************************
* EINGABESATZ EINLESEN UND PRUEFEN
*************************************************************
*
WORK1 DS 0H
*
READ READECB,SF,EING,(R3),'S'
*
CHECK READECB
*
AVAMODE SET31
#RET RC=0
*
EOFX DS 0H
*
AVAMODE SET31
#RET RC=4
*
SYNX DS 0H
*
AVAMODE SET31
#RET RC=12
*
*
*************************************************************
* DATEIENDE, DATEIEN SCHLIESSEN UND RAUS
*************************************************************
*
WORK2 DS 0H
*
CLOSE (EING)
*
AVAMODE SET31
#RET RC=0
*
*
*************************************************************
* NOTE-MAKRO ZUM ERMITTELN DER POSITION (TTR)
*************************************************************
*
WORK3 DS 0H
*
NOTE EING
ST R1,0(R3)
*
AVAMODE SET31
#RET RC=0
*
*
*************************************************************
* POINT-MAKRO ZUM POSITIONIEREN
*************************************************************
*
WORK4 DS 0H
*
POINT EING,0(R3)
*
AVAMODE SET31
#RET RC=0
*
*
*
*************************************************************
* DEFINITIONEN
*************************************************************
*
EING DCB DSORG=PO, *
MACRF=R, *
DDNAME=EING, *
RECFM=VB, *
SYNAD=SYNX, *
EODAD=EOFX
*
*
#END
*
END BSAMIO
you see, how the appropriate function is chosen depending on the first
parameter.
AVAMODE is a home grown macro to set the AMODE to 24 or 31 (because the
BSAM IO macros need AMODE 24, of course the module needs to have RMODE 24).
Hope this helps.
I don't care about dokumentation which tells me if DSORG=PO,RECFM=VB
will work;
for me it's important, that it DOES work (with MACRF=R).
Kind regards
Bernd
Am 25.03.2013 10:16, schrieb Elardus Engelbrecht:
Bernd Oppolzer wrote:
I found the Repair program for the PO Archive; it is from March 2001.
It is very kind of you to post it here.
There are two drawbacks:
- the comments are in German language
Good. It is not a drawback for me. ;-D
From RECFM=VB,
to RECFM=FBA,
Very interesting that you need to read the broken/original PO as a VB and very
large blocksize to copy it while placing text messages into the output too...
Is there any documentation / links which describe that you can use DSORG=PO
with RECFM=VB?
TIA! ;-D
Groete / Greetings
Elardus Engelbrecht
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN