Hi,
I have a situation where I need to load data from a note pad to a DB2 table in mainframe. I uploaded the data from PC to mainframe in 79 byte records. But, when I see the coma seperated data in mainframe, the column value is spread in two lines so Db2 can't read data properly.
For instance,
Below is the data in on PC side. Though it apperas here on two lines, it is on a single line in note pad.
Insert into A5555JAS.CXX_DATA values('PQR','*ERRD','CXR001',1,'1970-01-01',1,'ERRP','9999-12-31','C','00','R','H',08005,0,0,'N','','','2015-04-10-13.15.40.000000',90346); Commit;
But when it comes to mainframe as 79 bytes,
Insert into A5555JAS.CXX_DATA values('PQR','*ERRD','CXR001',1,'1970-01-01',1,'ERRP','9999-12-31','C','00','R','H',08005,0,0,'N','','','2015-04-10-13.15.40.000000',90346); Commit;
DB2 can't read data correctly since the column value for the date is split in to two lines,. Is there any way I could spread the data in two or three lines so that a coma will be the end of a line data and DB2 can read the data correctly?
Any suggestion will be greatly appreciated?
DB2 Dataload from PC to mainframe issue
-
- Posts: 12
- Joined: Sun Oct 17, 2010 12:06 am
- Skillset: COBOL/CICS/DB2/JCL
- Referer: Internet
- prino
- Posts: 641
- Joined: Wed Mar 11, 2009 12:22 am
- Skillset: PL/I - CICS - DB2 - IDMS - REXX - JCL, most in excess of three decades
- Referer: Google
- Location: Vilnius, Lithuania
- Contact:
Re: DB2 Dataload from PC to mainframe issue
Allocate a dataset with an LRECL > 79...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
robert.ah.prins @ the.17+Gb.Google thingy
-
- Posts: 12
- Joined: Sun Oct 17, 2010 12:06 am
- Skillset: COBOL/CICS/DB2/JCL
- Referer: Internet
Re: DB2 Dataload from PC to mainframe issue
Hi Robert,
There are several hundred lines of data. So, if I fix one line , data from another record will have the same issue as the one with 79 bytes. Is there any way we could get a comma as the last byte but record length is < 79 bytes. If I use . 79 bytes there will be issues.
There are several hundred lines of data. So, if I fix one line , data from another record will have the same issue as the one with 79 bytes. Is there any way we could get a comma as the last byte but record length is < 79 bytes. If I use . 79 bytes there will be issues.
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: DB2 Dataload from PC to mainframe issue
This is an EXTREMELY small amount of data -- millions (or even billions) of records are common on mainframes.There are several hundred lines of data
The BEST recommendation is to allocate a variable length blocked (VB) data set with a large enough record length to handle all the data -- if you don't know what that is, just use 27994 for the record length and 27998 for the block size. When you use a text transfer from the PC to the mainframe, the data will be transferred as it is on the PC (unless you have really long records) and you then can use the VB data set as input to DB2. Doing this is NOT handling a single record -- it is a generic solution for your problem.So, if I fix one line , data from another record will have the same issue as the one with 79 bytes
-
- Posts: 12
- Joined: Sun Oct 17, 2010 12:06 am
- Skillset: COBOL/CICS/DB2/JCL
- Referer: Internet
Re: DB2 Dataload from PC to mainframe issue
//STEP010 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB0T)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
LIB('DBDCSUP.DB2.DB0T.RUNLIB.LOAD')
END
//SYSPRINT DD DSN=XXXXXX.XXXXX.XXXX.XXXXXXX.DT0525,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(300,600),RLSE),
// UNIT=(SYSDA,48)
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
INSERT INTO A5555JAS.CRC_DATA VALUES('PQR','*ERRD','MR001',1,
'1970-01-01',1,'ERRD','9999-12-31','C','00','R','H',08005,0,0,
'N','','','2015-04-10-13.15.40.000000',90346); COMMIT;
/*
When above SYSIN was used, the query was executed successfully
----------------------------------------------------------------------------------------
But for below query, it failed with below message
//SYSIN DD *
INSERT INTO A5555JAS.CXX_DATA VALUES('PQR','*ERRD','MR001',1,'1970-01
-01',1,'ERRD','9999-12-31','C','00','R','H',08005,0,0,
'N','','','2015-04-10-13.15.40.000000',90346); COMMIT;
***INPUT STATEMENT:
INSERT INTO A55555JAS.CXX_DATA VALUES('PQR','*ERRD','MR001',1,'1970-01
-01',1,'ERRD','9999-12-31','C','00','R','H',08005,0,0,
'N','','','2015-04-10-13.15.40.000000',90346);
SQLERROR ON INSERT COMMAND, PREPARE FUNCTION
RESULT OF SQL STATEMENT:
DSNT408I SQLCODE = -180, ERROR: THE DATE, TIME, OR TIMESTAMP VALUE 19
DSNT418I SQLSTATE = 22007 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNXOLTD SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = -300 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'FFFFFED4' X'00000000' X'00000000' X'FFFFFFF
INFORMATION
I also tried with 240 bytes of data (above insert statement in one line ) but SYSIN will not take more than 80 bytes.
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB0T)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
LIB('DBDCSUP.DB2.DB0T.RUNLIB.LOAD')
END
//SYSPRINT DD DSN=XXXXXX.XXXXX.XXXX.XXXXXXX.DT0525,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(300,600),RLSE),
// UNIT=(SYSDA,48)
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
INSERT INTO A5555JAS.CRC_DATA VALUES('PQR','*ERRD','MR001',1,
'1970-01-01',1,'ERRD','9999-12-31','C','00','R','H',08005,0,0,
'N','','','2015-04-10-13.15.40.000000',90346); COMMIT;
/*
When above SYSIN was used, the query was executed successfully
----------------------------------------------------------------------------------------
But for below query, it failed with below message
//SYSIN DD *
INSERT INTO A5555JAS.CXX_DATA VALUES('PQR','*ERRD','MR001',1,'1970-01
-01',1,'ERRD','9999-12-31','C','00','R','H',08005,0,0,
'N','','','2015-04-10-13.15.40.000000',90346); COMMIT;
***INPUT STATEMENT:
INSERT INTO A55555JAS.CXX_DATA VALUES('PQR','*ERRD','MR001',1,'1970-01
-01',1,'ERRD','9999-12-31','C','00','R','H',08005,0,0,
'N','','','2015-04-10-13.15.40.000000',90346);
SQLERROR ON INSERT COMMAND, PREPARE FUNCTION
RESULT OF SQL STATEMENT:
DSNT408I SQLCODE = -180, ERROR: THE DATE, TIME, OR TIMESTAMP VALUE 19
DSNT418I SQLSTATE = 22007 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNXOLTD SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = -300 0 0 -1 0 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'FFFFFED4' X'00000000' X'00000000' X'FFFFFFF
INFORMATION
I also tried with 240 bytes of data (above insert statement in one line ) but SYSIN will not take more than 80 bytes.
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: DB2 Dataload from PC to mainframe issue
when posting data learn to use the code tags
text surrounded by the code tags is displayed with a fixed font and preserves the spaces
with ...
without
1234567890
* *
1234567890
help the people who spend their time helping You
text surrounded by the code tags is displayed with a fixed font and preserves the spaces
with ...
Code: Select all
1234567890
* *
1234567890
without
1234567890
* *
1234567890
help the people who spend their time helping You

cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: DB2 Dataload from PC to mainframe issue
If your site uses JES2, then yes the SYSIN limit is 80 bytes. If your site uses JES3 this is not true. It appears that you will need to write a program in the language of your choice to change your input data so each line of the INSERT ends with a comma.
-
- Global moderator
- Posts: 2105
- Joined: Thu Jun 03, 2010 6:21 pm
- Skillset: Assembler, JCL, utilities
- Referer: zos.efglobe.com
Re: DB2 Dataload from PC to mainframe issue
Another option is to do what PRINO and Robert Sample suggest; allocate a data set with a large LRECL, send just the data - not the JCL - to the mainframe. In the JCL, change
//SYSIN DD *
to
//SYSIN DD DISP=SHR,DSN=xxx
where xxx is the name of the data set containing the data.
//SYSIN DD *
to
//SYSIN DD DISP=SHR,DSN=xxx
where xxx is the name of the data set containing the data.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 3
- 5047
-
by jrcox
View the latest post
Wed Jul 29, 2020 7:52 pm
-
- 1
- 1340
-
by jcdm
View the latest post
Mon Oct 24, 2022 6:10 pm
-
- 2
- 2265
-
by Terry Heinze
View the latest post
Tue Feb 15, 2022 9:13 pm
-
-
Code conversion issue while reading JCL using REXX
by vsgurunath » Fri Jun 19, 2020 10:19 pm » in CLIST & REXX - 11
- 4304
-
by vsgurunath
View the latest post
Thu Jun 25, 2020 4:08 pm
-
-
-
Issue Create/delete ALIAS IDC3013I and then IDC3012I
by jcdm » Thu Dec 05, 2024 9:26 pm » in VSAM/SMS - 1
- 1699
-
by willy jensen
View the latest post
Fri Dec 06, 2024 12:04 am
-