× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Save files
  • From: "Mike Collins (syan)" <mike.collins@xxxxxxxxxx>
  • Date: Tue, 23 Jan 2001 15:56:52 +0000

Don't see how that helps you with a binary file sitting on a PC though?




Dave McKenzie <davemck@galois.com>@INTERNET@midrange.com> on 23/01/2001
15:48:49
Please respond to MI400 <MI400@midrange.com>@INTERNET
Sent by: owner-mi400 <owner-mi400@midrange.com>
To: MI400 <MI400@midrange.com>@INTERNET
cc:
Subject: Re: Save files

Hi James,

The following refers to RISC save files.  CISC save files are a little
different.

Note:
 1. All character fields are in EBCDIC.
 2. Save files consist of 528-byte records: 512 bytes of data, a 4-byte binary
RRN, and a 12-byte checksum.

Save files have a list of descriptors with the following structure:

Offset  Length in bytes   Description
  x00     4               xFFFFFFFF
  x04    30               Name
  x22     2               Type
  x92    24               "L/D OBJECT DESCRIPTOR   "
  xCC     4               Binary number of 528-byte records to the next
descriptor

Eight records (4224 bytes) after each descriptor is the data it describes.

The first descriptor is in record 9, so its offset into the file would be 4224
(8 x 528).  Its name is "QSRDSSPC.1" and its type is x19DB.
Its data is in record 17.  At offset 256 (x100) in the data is a header
structure:

Offset  Length in bytes   Description
  x00     1               Save command: x01=SAVOBJ; x02=SAVLIB
  x01     1               Release level of the structure
  x02    10               Library saved from

Physical file members in the save file each have a descriptor preceding them
with the name field being the file name (10 bytes) followed by the member name
(10 bytes).  The type field is x0B90, which is the type and subtype code for a
Data Space, the AS/400 object that stores records in physical files.

Other object types have descriptors containing their names and object types;
e.g. a program is type x0201, and a job description x1903.

So, by reading the header at offset 8704 (16 x 528 + 256), you can get the
library.  Then you can skip thru the descriptors by starting at record 9 and
adding "number of records to next descriptor" field to get to the next
descriptor, collecting object and member names from the descriptors as you go.

--Dave

"James H. H. Lampert" wrote:

> Fellow programmers:
>
> Does anybody know how to identify the library from which a save file was
> saved (and preferably also the objects/members saved) WITHOUT uploading
> the save file to an AS/400? (i.e., with the save file sitting on a PC to
> which it has been downloaded)
>
> The object of the exercise here is to be able to identify at least the
> library from whence a save file's contents came before uploading the
> save file and reconstituting it (with both operations taking place
> through an FTP port).
>
> --
> James H. H. Lampert
> Professional
> Dilettante
> http:/www.hb.quik.com/jamesl

+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---


+---
| This is the MI Programmers Mailing List!
| To submit a new message, send your mail to MI400@midrange.com.
| To subscribe to this list send email to MI400-SUB@midrange.com.
| To unsubscribe from this list send email to MI400-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: dr2@cssas400.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.