Hi
i have a requirement to send a file to my downstream application.
my TABLE structure is
DECLARE TAB003 TABLE
( ADDRESS_ID INTEGER NOT NULL,
CREATED_BY CHAR(8 NOT NULL,
CREATION_DATE TIMESTAMP NOT NULL,
LOCALITY_ID INTEGER NOT NULL,
STREET_ID INTEGER,
POT_ID SMALLINT,
LGA_TYPE VARCHAR(4))
i need to download data from this table, when i did that i am getting
" 12345abcd 2011-06-28 05:01:30.123456 78963 2349 32 adsd "
" 67891acgd 2011-06-28 05:01:30.123456 56432 4786 ? ?"
the length of the first record is 81 (displayed on file) but it should be 78.
in second record is 77 but it shoud be 78.
----in first record an extra space is added for all optional declarations( may be null or not null)
---in second record question mark is inserted at end for null fields
--- and for varchar first 2 bytes for length and next 4 for data, if null data ? is inserted in the 3 position.
MY QUESTION IS
1)how to download the data without the extra space for optional
declaration?
2) how to make the Varchar declaration as fixed( i need 4 spaces if no data or only the 4 character data?
i need the actual record length 78 to be downloaded..
please help?
i used COALESEC funtion but still i am getting the mismatch data..
Thanks,
Ganesh.
how to download table data with out extra ? for null values
Moderators: Kalicharan, Moderator Group
-
- Member
- Posts: 14
- Joined: Thu Jun 16, 2011 10:18 am
how to download table data with out extra ? for null values
Thanks,
Ganesh.
Ganesh.
-
- Member
- Posts: 14
- Joined: Thu Jun 16, 2011 10:18 am
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
before you can download data from one platform to another (mainframe to server/pc)
you need to unload your data from your db2 table.
what utility and control cards/sql are you using to unload your data?
you need to unload your data from your db2 table.
what utility and control cards/sql are you using to unload your data?
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
-
- Member
- Posts: 14
- Joined: Thu Jun 16, 2011 10:18 am
Hi Dick
i am using the utility ADUUMAIN
PGM=ADUUMAIN,
PARM='DB1T,,NEW
and in sysin dd
UNLOAD FORMAT EXTERNAL
UNLOADDN(SYSREC1)
SHRLEVEL CHANGE DIRECT NO
SELECT
ADDRESS_ID ,CREATED_BY, CREATION_DATE ,LOCALITY_ID,STREET_ID,POT_ID,LGA_TYPE)
FROM DADBU2.TAB003
FETCH FIRST 10 ROWS ONLY
WITH UR ;
SYSREC1 DD DSN=&HLQ..&MLQ..TAB003.D&ODATE,
DISP=(NEW,CATLG,DELETE),
SPACE=(CYL,(150,350),RLSE),UNIT=(SYSALLDA,25)
SYSCNTL DD DUMMY
i am using the utility ADUUMAIN
PGM=ADUUMAIN,
PARM='DB1T,,NEW
and in sysin dd
UNLOAD FORMAT EXTERNAL
UNLOADDN(SYSREC1)
SHRLEVEL CHANGE DIRECT NO
SELECT
ADDRESS_ID ,CREATED_BY, CREATION_DATE ,LOCALITY_ID,STREET_ID,POT_ID,LGA_TYPE)
FROM DADBU2.TAB003
FETCH FIRST 10 ROWS ONLY
WITH UR ;
SYSREC1 DD DSN=&HLQ..&MLQ..TAB003.D&ODATE,
DISP=(NEW,CATLG,DELETE),
SPACE=(CYL,(150,350),RLSE),UNIT=(SYSALLDA,25)
SYSCNTL DD DUMMY
Thanks,
Ganesh.
Ganesh.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page