473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DB2 DCLGEN

Hello,

Am out of the working world now but working on a project that requires
me to know what the output looks like from an IBM mainframe DCLGEN
operation.

In my days it would look something like the example below. Would it
look just the same today?

In TOTAL-CARS would the PIC spec be a series of 9's or would there be
replication brackets?

Any examples would be really helpful.

Also, when I do a similiar operation on my PC on a table (forget the
terminolgy, obviously something similiar), I don't get the DB2 area,
just the COBOL. Am using DB2 V7.1. Has that changed with later
versions? In particular, if somebody handed me that output, there's no
visible way of telling that it represents a DB2 table. Am I wrong?

Please, thanks,
Graham

This is a very old mainframe example, sorry about the formatting!

************************************************** ****************
* DCLGEN TABLE(DD10DATA) *
* LIBRARY(TWIGGYH.A.GS(SWSNUTS)) *
* ACTION(REPLACE) *
* LANGUAGE(COBOL) *
* APOST *
* ... IS THE DCLGEN COMM... LLOWING STATEMENTS *

************************************************** ****************
EXEC SQL DECLARE DD10DATA TABLE
( CUST_NUMB CHAR(5) NOT NULL,
CUST_NAME CHAR(33) NOT NULL,
ADDRESS_1 CHAR(33) NOT NULL,
ADDRESS_2 CHAR(31) NOT NULL,
POST_CODE CHAR(7) NOT NULL,
ATTENTION CHAR(10) NOT NULL,
VAT_REGTN_VVVVVVVVVVVVVV_REGTN CHAR(10) NOT NULL,
IN_STOCKS_TTTTTTTTTTTX DECIMAL(7, 0) NOT NULL,
TOTAL_CARS DECIMAL(7, 0) NOT NULL,
ZD_FIELD DECIMAL(3, 1) NOT NULL,
ZU_FIELD DECIMAL(3, 2) NOT NULL
) END-EXEC.

************************************************** ****************
* COBOL DECLARATION FOR TABLE DD10DATA *

************************************************** ****************
01 DCL-DD10DATA.
10 CUST-NUMB PIC X(5).
10 CUST-NAME PIC X(33).
10 ADDRESS-1 PIC X(33).
10 ADDRESS-2 PIC X(31).
10 POST-CODE PIC X(7).
10 ATTENTION PIC X(10).
10 VAT-REGTN-VVVVVVVVVVVVVV-REGTN PIC X(10).
10 IN-STOCKS-TTTTTTTTTTTX PIC S9999999V USAGE COMP-3.
10 TOTAL-CARS PIC S9999999V USAGE COMP-3.
10 ZD-FIELD PIC S9(2)V9(1) USAGE
COMP-3.
10 ZU-FIELD PIC S9(1)V9(2) USAGE
COMP-3.

************************************************** ****************
* THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 11
*

************************************************** ****************


--
Posted via a free Usenet account from http://www.teranews.com

Mar 23 '08 #1
3 4370
"Graham Hobbs" <gh****@cdpwise.netwrote in message
news:bp********************************@4ax.com...
Hello,

Am out of the working world now but working on a project that requires
me to know what the output looks like from an IBM mainframe DCLGEN
operation.

In my days it would look something like the example below. Would it
look just the same today?
Yes.
In TOTAL-CARS would the PIC spec be a series of 9's or would there be
replication brackets?
Not sure. Why do you care?
Any examples would be really helpful.

Also, when I do a similiar operation on my PC on a table (forget the
terminolgy, obviously something similiar), I don't get the DB2 area,
just the COBOL. Am using DB2 V7.1. Has that changed with later
versions? In particular, if somebody handed me that output, there's no
visible way of telling that it represents a DB2 table. Am I wrong?
If you are talking about DB2 for Windows (or Linux, UNIX, or OS/2) then
there is no DCLGEN command on that platform.
Mar 23 '08 #2


Graham Hobbs wrote:
Hello,

Am out of the working world now but working on a project that requires
me to know what the output looks like from an IBM mainframe DCLGEN
operation.

In my days it would look something like the example below. Would it
look just the same today?

In TOTAL-CARS would the PIC spec be a series of 9's or would there be
replication brackets?

Any examples would be really helpful.

Also, when I do a similiar operation on my PC on a table (forget the
terminolgy, obviously something similiar), I don't get the DB2 area,
just the COBOL. Am using DB2 V7.1. Has that changed with later
versions? In particular, if somebody handed me that output, there's no
visible way of telling that it represents a DB2 table. Am I wrong?

Please, thanks,
Graham

This is a very old mainframe example, sorry about the formatting!

************************************************** ****************
* DCLGEN TABLE(DD10DATA) *
* LIBRARY(TWIGGYH.A.GS(SWSNUTS)) *
* ACTION(REPLACE) *
* LANGUAGE(COBOL) *
* APOST *
* ... IS THE DCLGEN COMM... LLOWING STATEMENTS *

************************************************** ****************
EXEC SQL DECLARE DD10DATA TABLE
( CUST_NUMB CHAR(5) NOT NULL,
CUST_NAME CHAR(33) NOT NULL,
ADDRESS_1 CHAR(33) NOT NULL,
ADDRESS_2 CHAR(31) NOT NULL,
POST_CODE CHAR(7) NOT NULL,
ATTENTION CHAR(10) NOT NULL,
VAT_REGTN_VVVVVVVVVVVVVV_REGTN CHAR(10) NOT NULL,
IN_STOCKS_TTTTTTTTTTTX DECIMAL(7, 0) NOT NULL,
TOTAL_CARS DECIMAL(7, 0) NOT NULL,
ZD_FIELD DECIMAL(3, 1) NOT NULL,
ZU_FIELD DECIMAL(3, 2) NOT NULL
) END-EXEC.

************************************************** ****************
* COBOL DECLARATION FOR TABLE DD10DATA *

************************************************** ****************
01 DCL-DD10DATA.
10 CUST-NUMB PIC X(5).
10 CUST-NAME PIC X(33).
10 ADDRESS-1 PIC X(33).
10 ADDRESS-2 PIC X(31).
10 POST-CODE PIC X(7).
10 ATTENTION PIC X(10).
10 VAT-REGTN-VVVVVVVVVVVVVV-REGTN PIC X(10).
10 IN-STOCKS-TTTTTTTTTTTX PIC S9999999V USAGE COMP-3.
10 TOTAL-CARS PIC S9999999V USAGE COMP-3.
10 ZD-FIELD PIC S9(2)V9(1) USAGE
COMP-3.
10 ZU-FIELD PIC S9(1)V9(2) USAGE
COMP-3.

************************************************** ****************
* THE NUMBER OF COLUMNS DESCRIBED BY THIS DECLARATION IS 11
*

************************************************** ****************

No, on an IBM mainframe, it would appear as PIC S9(7) USAGE COMP-3.
Mar 24 '08 #3
Gentlemen,
Thanks, is what I needed to know.
Graham

--
Posted via a free Usenet account from http://www.teranews.com

Mar 25 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: ghobbs | last post by:
I have a memory lapse (not the first!) and could use some help. I have DB2 V7.1 on my PC plus VisualAge Cobol V2.2. There is a facility in one of these products which produces a COBOL copybook...
0
by: srvaspreddy | last post by:
Hi Friends, What are the ways we have to compare data size in DCLGEN and DB2 catalogues?.
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
0
by: msmithuk | last post by:
Hi, I am writing a PL/1 program which will be reading a DB2 Table which has a column defined as a CLOB. Therefore, I should use DCLGEN to obtain accurate SQL DECLARE TABLE statements. However...
0
by: rsilvers | last post by:
what type of overhead will this select statement cause to db2 on z/os mainframe ? This is an imbedded SQL in COBOL Declare cursor C1 for select number, key1, key2 from table where type =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.