Answers embedded below Joe.

Jon Paris
Partner400
www.Partner400.com

-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx]On Behalf Of Joe Pluta
Sent: Thursday, April 17, 2003 10:49 AM
To: COBOL Programming on the iSeries/AS400
Subject: ACCEPT and the INFDS


Hi everyone!

I'm back with newbie question number 736: the file informational data
structure.  I've gotten to the point where I think I understand that you
have to do an ACCEPT which transfers the contents of the INFDS to a working
storage buffer.

>> Correct

My question is this: is the layout of that working storage buffer fixed, or
are the names significant?  The one I've seen has a bunch of filler fields,
which leads me to think that the names are not significant, but that the
positions are.

>> There is no significance to the names.  COBOL maps directly into the
system Open and IO feedback areas.  The data layout is therefore as
described in the Data Management documentation.  RPG does this strange thing
of re-mapping parts of the structure and then copying the rest at the end.
COBOL takes a more straightforward approach.


Even more newbie, what's the length of the data structure?  Is it like RPG,
where the longer you specify the more fields you get?  Or is there a fixed
length it needs to be?  And as a simple corollary, is there a syntax in
COBOL that will get me the length of a field that has subfields?

>> Don't recall the exact length - I think it can vary by device type etc.
Years since I did this stuff.  Check the DM manual.  But it doesn't really
matter if everything you want is in the common portion - just define as many
of the fields as you need - the compiler will take care of filling it in.

And finally, in a blinding burst of newbieness, say I have two 01-level
fields, both with lots of 05 and 10 subfields.  FIELDA is 100 characters,
FIELDB is 75.  If I MOVE FIELDA TO FIELDB, does this move the first 75 bytes
(positions 1-75) of FIELDA to FIELDB, or the last 75 (positions 26-100)?
I'm pretty sure its the former, but this whole thing has confused me no end.

>> COBOL character moves are always from the first (left-most) char in the
source to the left most in the receiver.  If the receiver is smaller then
the data is truncated, if larger the balance is space filled.  For numeric
fields, the alignment is made around the decimal point.  Don't forget that
moves can be done from/to any level.  So the 05 group level containing any
number of 10s can be moved to an 01 or an 05 or ......

Okay, now.  Stop laughing.  Get off the floor.

>> No laughs - I still screw up with RPG MOVEs because they don't behave the
way I think they should.  That's why I love eval!

Joe


_______________________________________________
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo.cgi/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.



This thread ...

Follow-Ups:
Replies:

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

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