MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Issue in Loading Data to DB2 from a PC note pad

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
tdnj
Beginner


Joined: 10 Oct 2010
Posts: 6
Topics: 3

PostPosted: Sat May 23, 2015 10:02 am    Post subject: Issue in Loading Data to DB2 from a PC note pad Reply with quote

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 separated 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?

There are several hundred lines of data to be loaded in DB2. Any suggestion will be greatly appreciated?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Sat May 23, 2015 1:59 pm    Post subject: Reply with quote

tdnj,

How are you inserting the rows in to the table? Running it via SPUFI or in batch using IKJEFT01? Either way you shouldn't have any problem as your data is limited to 80 bytes of sysin data.

It doesn't matter as to how many lines the data is split into. As long as your number of columns match the number of values you inserting it should be fine.

you need to show us the error you are getting when you execute that insert statement.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tdnj
Beginner


Joined: 10 Oct 2010
Posts: 6
Topics: 3

PostPosted: Sat May 23, 2015 3:31 pm    Post subject: Reply with quote

Code:

//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;           
/*

I manually edited the SYSIN and when above SYSIN was used, the query was executed successfully
----------------------------------------------------------------------------------------

But for below query, it failed with below message
Code:

//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 D9331COZ.CRC_DATA VALUES('OEB','*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                                                 
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Sun May 24, 2015 3:18 pm    Post subject: Reply with quote

tdnj,

The reason you are getting the -180 error is due to the date field being broken across lines. Are all your records split into a different line on the date field?

How are you uploading to the mainframe? FTP? or PCOMM transfer?

If you are using emulator transfer method , I suggest that you override the mainframe file LRECL to 133 , so that the lines do not get truncated.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sun May 24, 2015 5:08 pm    Post subject: Reply with quote

This is the third posting of this topic I have come across today - and I have only looked at 3 forums so far. I have locked on one the other was the original one that I looked at so left it.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group