Midrange News for the IBM i Community


Posted by: rpgprogrammer
Vancouver, BC
SQLRPG
has no ratings.
Published: 31 Jul 2012
Revised: 23 Jan 2013 - 1647 days ago
Last viewed on: 27 Jul 2017 (3095 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

SQLRPG Published by: rpgprogrammer on 31 Jul 2012 view comments(6)

Hi,

I am trying to execute below command through SQLRPGLE I get below error

Data mapping error on member SRC1.
 

C                  EVAL      W0STAMT = 'CREATE ALIAS QTEMP/TEMPFILE1 FOR '      
C                                   + %TRIM(MLLIBN) + '/' + %TRIM(MLSFIL)       
C                                     + ' (' + %TRIM(MLNAME) + ')'              

 

In Debug mode once the above command is executed, I go to STRSQL and do a Runqry in TEMPFILE1 I see above error message.

What I notice is for other source SRCDAT has some value while for the source in error the value of SRCDAT = ++++++ as seen above.

Can some one help to know why I am getting Data Mapping Error for this source(SRC1)?  For other sources it is working file.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: SQLRPG
Posted: 4 years 11 months 27 days 22 hours 1 minutes ago

You have crap in your Source Change Date. The SEQNBR and CHGDATE fields (SRCDTA and SRCDAT) are Zoned(6,0) and depending on how they were created, might contains blanks instead of zeros or other numeric data. I would open/save/close the file in SEU once to fix the program by resequencing that source member.

Posted by: rpgprogrammer
Premium member *
Vancouver, BC
Comment on: SQLRPG
Posted: 4 years 11 months 27 days 21 hours 53 minutes ago

Thanks Bob, But the sources are locked as those are production sources which we cannot change.  Is there any way we can change the source temporary?  We are reading this source in batch so cannot do it manually.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: SQLRPG
Posted: 4 years 11 months 27 days 20 hours 23 minutes ago

You might be able to do a CASE/WHEN statement and insert zeros if the field contains X'40'.

How is it being read? RPG, CL, Embedded SQL?

Posted by: rpgprogrammer
Premium member *
Vancouver, BC
Comment on: SQLRPG
Posted: 4 years 11 months 27 days 19 hours 43 minutes ago

Embedded SQL

Posted by: rpgprogrammer
Premium member *
Vancouver, BC
Comment on: SQLRPG
Posted: 4 years 11 months 27 days 19 hours 42 minutes ago

If you change the value to zeros through SQL, it changes the source change date as I am using Alias in Qtemp.   We dont have access to production source so the date will not change. 

Posted by: DaleB
Premium member *
Reading, PA
Comment on: SQLRPG
Posted: 4 years 11 months 27 days 4 hours 7 minutes ago

Can you ignore the SRCDAT in your SQL statement? Instead of SELECT *, do SELECT SRCDTA?