Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Layout Hell.
Hi,
Could I have some help with this layout?
I am new to the layout scene, but if I could see some real examples, I might
get it. Then again, I might club myself with a shovel.
Thank you.
I just need to convert this file to Access or something normal.
Do you have any thoughts?
Thanks you.

77  FILLER      PIC X(16)  VALUE 'CTLG==(ANDERA)===='.
01  WWICTLG.
10 CTLGOP-CO-NO              PIC X(3).
10 CTLGCONTROL-SET-SEQ-NO    PIC S9(9) USAGE COMP.
10 CTLGINVOICE-SEQ-NO        PIC S9(4) USAGE COMP.
10 CTLGAP-CNTRL-ENTITY-CD    PIC X(4).
10 CTLGINVOICE-TYPE-CD       PIC X(2).
10 CTLGLEGACY-VENDOR-NO      PIC X(10).
10 CTLGAP-VENDOR-NO          PIC X(30).
10 CTLGAP-PO-NO              PIC X(30).
10 CTLGAP-INVOICE-NO         PIC X(30).
10 CTLGINVOICE-DT            PIC X(10).
10 CTLGTOTAL-INVOICE-AM      PIC S9(11)V9(2) USAGE COMP-3.
10 CTLGTOTAL-MERCH-AM        PIC S9(11)V9(2) USAGE COMP-3.
10 CTLGTERMS-CD              PIC X(2).
10 CTLGCARRIER-CD            PIC X(10).
10 CTLGCARRIER-PRO-NO        PIC X(10).
10 CTLGSHIP-DT               PIC X(10).
10 CTLGSHIP-VIA-CD           PIC X(3).
10 CTLGSHIP-LOC-NO           PIC X(3).
10 CTLGSHIP-WT               PIC X(10).
10 CTLGSHIP-UNITS-DC         PIC X(10).
10 CTLGSHIP-TY               PIC X(2).
77 POSBOP-CO-NO             PIC S9(4) COMP.
77 POSBCONTROL-SET-SEQ-NO   PIC S9(4) COMP.
77 POSBINVOICE-SEQ-NO       PIC S9(4) COMP.
77 POSBAP-CNTRL-ENTITY-CD   PIC S9(4) COMP.
77 POSBINVOICE-TYPE-CD      PIC S9(4) COMP.
77 POSBLEGACY-VENDOR-NO     PIC S9(4) COMP.
77 POSBAP-VENDOR-NO         PIC S9(4) COMP.
77 POSBAP-PO-NO             PIC S9(4) COMP.
77 POSBAP-INVOICE-NO        PIC S9(4) COMP.
77 POSBINVOICE-DT           PIC S9(4) COMP.
77 POSBTOTAL-INVOICE-AM     PIC S9(4) COMP.
77 POSBTOTAL-MERCH-AM       PIC S9(4) COMP.
77 POSBTERMS-CD             PIC S9(4) COMP.
77 POSBCARRIER-CD           PIC S9(4) COMP.
77 POSBCARRIER-PRO-NO       PIC S9(4) COMP.
77 POSBSHIP-DT              PIC S9(4) COMP.
77 POSBSHIP-VIA-CD          PIC S9(4) COMP.
77 POSBSHIP-LOC-NO          PIC S9(4) COMP.
77 POSBSHIP-WT              PIC S9(4) COMP.
77 POSBSHIP-UNITS-DC        PIC S9(4) COMP.
77 POSBSHIP-TY              PIC S9(4) COMP.



Report this thread to moderator Post Follow-up to this message
Old Post
Carol
07-16-04 01:55 AM


Re: Layout Hell.
"Carol" <kgdg@helkusa.com> wrote in message
news:JZCdnZ690pjbiWrd4p2dnA@comcast.com...
> Could I have some help with this layout?
> I am new to the layout scene, but if I could see some real examples, I
might
> get it. Then again, I might club myself with a shovel.
> Thank you.
> I just need to convert this file to Access or something normal.

Um, if by "convert this file" you mean "convert the record layout" then your
X fields are alpha, your PIC 9 fields are numeric, usage immaterial...
CREATE TABLE  tablename (co_no VARCHAR(3), set_seq_no INTEGER,
...total_invoice_am NUMBER(11,2) (although specifically with MS-Access or
other engines based on Jet, CURRENCY might be a better choice for the
decimal money fields.).....

Or did you mean, convert some DATA currently residing in a file described by
this layout?

Well, that's a horse of another color; as well as a current topic here....
witnesseth this clip and my response, equally applicable.....

== BEGIN QUOTEe===
Scott Hooper" <shooper@rxworks.com> wrote in message
news:a8341757.0407142138.560efc01@posting.google.com...
> I have read through all the newsgroups I could find and am getting
> very  about what to do with my files. I have a heaps of
> FILExxxx.DAT files, some with matching .CTL files, that I need to read
> into something like Access, dBase or delimited text. The files were
> created using a custom program written in RM/COBOL-85. I have all the
> .COB files. What I can't do is spend any money on a one-off tool. I'm
> hoping that somebody can offer me a VB, VB.NET or C# code solution for
> reading these.

Tutorial: Using COBOL-created data with non-COBOL programs.

http://www.talsystems.com/tsihome_h...oads/C2IEEE.htm

The price is right (free for use).

Basically that will tell you you MUST have the COBOL FD or other record
layout documentation - but if you have the *.COB files, you have these
descriptions, so you are probably beyond the most frequent barrier to
success.

I have a Win/32 DLL which uses the FD info and then converts the data to
IEEE format; and several "base" conversion programs (BASIC language). Sounds
like that software would probably be exactly what you want.... except the
part where you say, " What I can't do is spend any money on a one-off tool."

But if you change your mind and are interested in a package of BASIC
language source/executable (PowerBASIC/Windows, very usable with Microsoft
Visual BASIC or any "C" for Windows)   - with the understanding it is not
free - please contact my office.

== END QUOTE ===


--
Michael Mattias
Tal Systems, Inc.
Racine WI
mmattias@talsystems.com





Report this thread to moderator Post Follow-up to this message
Old Post
Michael Mattias
07-16-04 01:55 AM


Re: Layout Hell.
You are not making yourself clear at all.  You have provided one record:

01  WWICTLG.
>            10 CTLGOP-CO-NO              PIC X(3).
>            10 CTLGCONTROL-SET-SEQ-NO    PIC S9(9) USAGE COMP.
>            10 CTLGINVOICE-SEQ-NO        PIC S9(4) USAGE COMP.
>            10 CTLGAP-CNTRL-ENTITY-CD    PIC X(4).
>            10 CTLGINVOICE-TYPE-CD       PIC X(2).
>            10 CTLGLEGACY-VENDOR-NO      PIC X(10).
>            10 CTLGAP-VENDOR-NO          PIC X(30).
>            10 CTLGAP-PO-NO              PIC X(30).
>            10 CTLGAP-INVOICE-NO         PIC X(30).
>            10 CTLGINVOICE-DT            PIC X(10).
>            10 CTLGTOTAL-INVOICE-AM      PIC S9(11)V9(2) USAGE COMP-3.
>            10 CTLGTOTAL-MERCH-AM        PIC S9(11)V9(2) USAGE COMP-3.
>            10 CTLGTERMS-CD              PIC X(2).
>            10 CTLGCARRIER-CD            PIC X(10).
>            10 CTLGCARRIER-PRO-NO        PIC X(10).
>            10 CTLGSHIP-DT               PIC X(10).
>            10 CTLGSHIP-VIA-CD           PIC X(3).
>            10 CTLGSHIP-LOC-NO           PIC X(3).
>            10 CTLGSHIP-WT               PIC X(10).
>            10 CTLGSHIP-UNITS-DC         PIC X(10).
>            10 CTLGSHIP-TY               PIC X(2).
>

I looked up what the 77 levels are used for and the book says, "You use 77
level to define an independent data item -- one that is not related in any
way to any of the data around it. There is nothing you can do with a 77
level you can't do with an 01 level."

So what you have here is one record, the part under the 01 to the next 77
level and a series of independent data variable names marked with the 77
levels.

A record layout is just an expression of a data record and its component
parts.  Say if I wanted to do something like the following:

01 test-record              pic x(132).

01 test-record-parts redefines
test-record.
05 alpha-data         pic x(30).
05 date-data           pic 9(10).
05 more-alpha-data pic x(30).
05 numeric-data     pic 9(20).
05 some-more-numeric-data pic 9(20).
05 filler                    pic x(22).

You can break the record down to each individual byte of the record if you
want but typically you have information taking more than one byte and you
are just telling the  the program by the use of the variable name what bytes
belong with what variable.

Don't get all bound up in the "comp" fields they are just a way of defining
a storage method for the data.  A record is not required to use comp fields
but as you get more experience with cobol you will find out that you want to
store data in the most efficient way you can so you save disk/tape space and
programs can do certain tasks faster when stored with comp fields.



The stuff dealing with 77 levels don't appear to function as part of the
record layout listed in the 01 level.

"Michael Mattias" <michael.mattias@gte.net> wrote in message
news:FTEJc.1591$4L7.319@newssvr33.news.prodigy.com...
> "Carol" <kgdg@helkusa.com> wrote in message
> news:JZCdnZ690pjbiWrd4p2dnA@comcast.com... 
> might 
>
> Um, if by "convert this file" you mean "convert the record layout" then
your
> X fields are alpha, your PIC 9 fields are numeric, usage immaterial...
> CREATE TABLE  tablename (co_no VARCHAR(3), set_seq_no INTEGER,
> ...total_invoice_am NUMBER(11,2) (although specifically with MS-Access or
> other engines based on Jet, CURRENCY might be a better choice for the
> decimal money fields.).....
>
> Or did you mean, convert some DATA currently residing in a file described
by
> this layout?
>
> Well, that's a horse of another color; as well as a current topic here....
> witnesseth this clip and my response, equally applicable.....
>
> == BEGIN QUOTEe===
> Scott Hooper" <shooper@rxworks.com> wrote in message
> news:a8341757.0407142138.560efc01@posting.google.com... 
>
> Tutorial: Using COBOL-created data with non-COBOL programs.
>
> http://www.talsystems.com/tsihome_h...oads/C2IEEE.htm
>
> The price is right (free for use).
>
> Basically that will tell you you MUST have the COBOL FD or other record
> layout documentation - but if you have the *.COB files, you have these
> descriptions, so you are probably beyond the most frequent barrier to
> success.
>
> I have a Win/32 DLL which uses the FD info and then converts the data to
> IEEE format; and several "base" conversion programs (BASIC language).
Sounds
> like that software would probably be exactly what you want.... except the
> part where you say, " What I can't do is spend any money on a one-off
tool."
>
> But if you change your mind and are interested in a package of BASIC
> language source/executable (PowerBASIC/Windows, very usable with Microsoft
> Visual BASIC or any "C" for Windows)   - with the understanding it is not
> free - please contact my office.
>
> == END QUOTE ===
>
>
> --
> Michael Mattias
> Tal Systems, Inc.
> Racine WI
> mmattias@talsystems.com
>
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Charles W. Cribbs II
07-16-04 01:55 AM


Re: Layout Hell.
You are right.
I am not making myslef clear at all.
Still, the info you sent is helping me.

I have a job to convert these tapes form cobol to ascii text.
I have a program to do this, but as you know I have to script it with the
file layout.




Report this thread to moderator Post Follow-up to this message
Old Post
Carol
07-16-04 08:55 AM


Re: Layout Hell.
77's always precede 01-99's. Other than that, I didn't really look
at the definition detail.


Gary




"Carol" <kgdg@helkusa.com> wrote in message
news:JZCdnZ690pjbiWrd4p2dnA@comcast.com...
> Hi,
> Could I have some help with this layout?
> I am new to the layout scene, but if I could see some real examples, I
might
> get it. Then again, I might club myself with a shovel.
> Thank you.
> I just need to convert this file to Access or something normal.
> Do you have any thoughts?
> Thanks you.
>
>        77  FILLER      PIC X(16)  VALUE 'CTLG==(ANDERA)===='.
>        01  WWICTLG.
>            10 CTLGOP-CO-NO              PIC X(3).
>            10 CTLGCONTROL-SET-SEQ-NO    PIC S9(9) USAGE COMP.
>            10 CTLGINVOICE-SEQ-NO        PIC S9(4) USAGE COMP.
>            10 CTLGAP-CNTRL-ENTITY-CD    PIC X(4).
>            10 CTLGINVOICE-TYPE-CD       PIC X(2).
>            10 CTLGLEGACY-VENDOR-NO      PIC X(10).
>            10 CTLGAP-VENDOR-NO          PIC X(30).
>            10 CTLGAP-PO-NO              PIC X(30).
>            10 CTLGAP-INVOICE-NO         PIC X(30).
>            10 CTLGINVOICE-DT            PIC X(10).
>            10 CTLGTOTAL-INVOICE-AM      PIC S9(11)V9(2) USAGE COMP-3.
>            10 CTLGTOTAL-MERCH-AM        PIC S9(11)V9(2) USAGE COMP-3.
>            10 CTLGTERMS-CD              PIC X(2).
>            10 CTLGCARRIER-CD            PIC X(10).
>            10 CTLGCARRIER-PRO-NO        PIC X(10).
>            10 CTLGSHIP-DT               PIC X(10).
>            10 CTLGSHIP-VIA-CD           PIC X(3).
>            10 CTLGSHIP-LOC-NO           PIC X(3).
>            10 CTLGSHIP-WT               PIC X(10).
>            10 CTLGSHIP-UNITS-DC         PIC X(10).
>            10 CTLGSHIP-TY               PIC X(2).
>        77 POSBOP-CO-NO             PIC S9(4) COMP.
>        77 POSBCONTROL-SET-SEQ-NO   PIC S9(4) COMP.
>        77 POSBINVOICE-SEQ-NO       PIC S9(4) COMP.
>        77 POSBAP-CNTRL-ENTITY-CD   PIC S9(4) COMP.
>        77 POSBINVOICE-TYPE-CD      PIC S9(4) COMP.
>        77 POSBLEGACY-VENDOR-NO     PIC S9(4) COMP.
>        77 POSBAP-VENDOR-NO         PIC S9(4) COMP.
>        77 POSBAP-PO-NO             PIC S9(4) COMP.
>        77 POSBAP-INVOICE-NO        PIC S9(4) COMP.
>        77 POSBINVOICE-DT           PIC S9(4) COMP.
>        77 POSBTOTAL-INVOICE-AM     PIC S9(4) COMP.
>        77 POSBTOTAL-MERCH-AM       PIC S9(4) COMP.
>        77 POSBTERMS-CD             PIC S9(4) COMP.
>        77 POSBCARRIER-CD           PIC S9(4) COMP.
>        77 POSBCARRIER-PRO-NO       PIC S9(4) COMP.
>        77 POSBSHIP-DT              PIC S9(4) COMP.
>        77 POSBSHIP-VIA-CD          PIC S9(4) COMP.
>        77 POSBSHIP-LOC-NO          PIC S9(4) COMP.
>        77 POSBSHIP-WT              PIC S9(4) COMP.
>        77 POSBSHIP-UNITS-DC        PIC S9(4) COMP.
>        77 POSBSHIP-TY              PIC S9(4) COMP.
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
The Family
07-16-04 08:55 AM


Re: Layout Hell.
Well that will be pretty simple then.

Take that record layout and for the fields with comp in them just make your
text file show a pic 9(same length as what comp field specifies).


"Carol" <kgdg@helkusa.com> wrote in message
news:VLSdnUGwEp_EumrdRVn-ig@comcast.com...
> You are right.
> I am not making myslef clear at all.
> Still, the info you sent is helping me.
>
> I have a job to convert these tapes form cobol to ascii text.
> I have a program to do this, but as you know I have to script it with the
> file layout.
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Charles W. Cribbs II
07-16-04 08:55 AM


Re: Layout Hell.
Huh ???

I think that MAY have been required by the '68 Standard - but not since.  Is
there a compiler still supported that requires 77 levels to be coded before
01-levels?

--
Bill Klein
wmklein <at> ix.netcom.com
"The Family" <lgvwalk@swbell.net> wrote in message
news:P0GJc.8950$OA6.6225@newssvr23.news.prodigy.com...
>
> 77's always precede 01-99's. Other than that, I didn't really look
> at the definition detail.
>
>
> Gary
>
>
>
>
> "Carol" <kgdg@helkusa.com> wrote in message
> news:JZCdnZ690pjbiWrd4p2dnA@comcast.com... 
> might 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
William M. Klein
07-16-04 08:55 AM


Re: Layout Hell.
Carol wrote:
> Hi,
> Could I have some help with this layout?
> I am new to the layout scene, but if I could see some real examples,
> I might get it. Then again, I might club myself with a shovel.
> Thank you.
> I just need to convert this file to Access or something normal.

No you don't. It's already more normal than anything to which you could
convert it.

> Do you have any thoughts?

I have placed the number of bytes each field uses (usually, beware of
compiler dependencies) in square brackets. If that's insufficient, come back
with more specific questions.

(P.S., "77" levels are not involved in the record. They may be ignored for
this purpose.)

> Thanks you.
>
>        01  WWICTLG.
>            10 CTLGOP-CO-NO              PIC X(3). [3]
>            10 CTLGCONTROL-SET-SEQ-NO    PIC S9(9) USAGE COMP. [4]*
>            10 CTLGINVOICE-SEQ-NO        PIC S9(4) USAGE COMP. [4]*
>            10 CTLGAP-CNTRL-ENTITY-CD    PIC X(4). [4]
>            10 CTLGINVOICE-TYPE-CD       PIC X(2). [2]
>            10 CTLGLEGACY-VENDOR-NO      PIC X(10). [10]
>            10 CTLGAP-VENDOR-NO          PIC X(30). [30]
>            10 CTLGAP-PO-NO              PIC X(30). [30]
>            10 CTLGAP-INVOICE-NO         PIC X(30). [30]
>            10 CTLGINVOICE-DT            PIC X(10). [10]
>            10 CTLGTOTAL-INVOICE-AM      PIC S9(11)V9(2) USAGE COMP-3.
[7]**
>            10 CTLGTOTAL-MERCH-AM        PIC S9(11)V9(2) USAGE COMP-3. [7]
>            10 CTLGTERMS-CD              PIC X(2). [2]
>            10 CTLGCARRIER-CD            PIC X(10). [10]
>            10 CTLGCARRIER-PRO-NO        PIC X(10). [10]
>            10 CTLGSHIP-DT               PIC X(10). [10]
>            10 CTLGSHIP-VIA-CD           PIC X(3). [3]
>            10 CTLGSHIP-LOC-NO           PIC X(3). [3]
>            10 CTLGSHIP-WT               PIC X(10). [10]
>            10 CTLGSHIP-UNITS-DC         PIC X(10). [10]
>            10 CTLGSHIP-TY               PIC X(2). [2]

* = Binary Fullword, 4 bytes because of its size (>4 digits)
** = Packed Decimal (number-of-digits + 1) / 2. No other database system
uses Packed Decimal. You have your work cut out to convert to a "normal"
number.



Report this thread to moderator Post Follow-up to this message
Old Post
JerryMouse
07-16-04 08:55 AM


Re: Layout Hell.
Jerry, is there some table out there that lists all possible COBOL fields
( PIC X(3),PIC S9(9) ) and the number of bytes they take up, so that I can
just copy and paste or even write a little script?
thanks






"JerryMouse" <nospam@bisusa.com> wrote in message
news:FfWdnajyuePaoGrdRVn-hw@giganews.com...
> Carol wrote: 
>
> No you don't. It's already more normal than anything to which you could
> convert it.
> 
>
> I have placed the number of bytes each field uses (usually, beware of
> compiler dependencies) in square brackets. If that's insufficient, come
back
> with more specific questions.
>
> (P.S., "77" levels are not involved in the record. They may be ignored for
> this purpose.)
> 
> [7]** 
[7] 
>
> * = Binary Fullword, 4 bytes because of its size (>4 digits)
> ** = Packed Decimal (number-of-digits + 1) / 2. No other database system
> uses Packed Decimal. You have your work cut out to convert to a "normal"
> number.
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Carol
07-16-04 08:55 AM


Re: Layout Hell.
Perhaps not. I thought about that just as I was making that post.

But, I still was not aware that 77's & 01-99's could be mixed,
and further, why would someone want to? Frankly, I haven't
seen much use in 77's in some time anyway.

Thanks, for the update....

Gary




"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:0IGJc.4104$mL5.2263@newsread1.news.pas.earthlink.net...
> Huh ???
>
> I think that MAY have been required by the '68 Standard - but not since.
Is
> there a compiler still supported that requires 77 levels to be coded
before
> 01-levels?
>
> --
> Bill Klein
>  wmklein <at> ix.netcom.com
> "The Family" <lgvwalk@swbell.net> wrote in message
> news:P0GJc.8950$OA6.6225@newssvr23.news.prodigy.com... 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
The Family
07-16-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Pages (6): [1] 2 3 4 5 6 »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:57 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.