Midrange News for the IBM i Community


Posted by: rpgprogrammer
Vancouver, BC
SQLRPG
has no ratings.
Published: 31 Jul 2012
Revised: 23 Jan 2013 - 2805 days ago
Last viewed on: 26 Sep 2020 (4495 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)

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: 8 years 1 months 27 days 10 hours 40 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: 8 years 1 months 27 days 10 hours 32 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: 8 years 1 months 27 days 9 hours 1 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: 8 years 1 months 27 days 8 hours 22 minutes ago

Embedded SQL

Posted by: rpgprogrammer
Premium member *
Vancouver, BC
Comment on: SQLRPG
Posted: 8 years 1 months 27 days 8 hours 21 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: 8 years 1 months 26 days 16 hours 45 minutes ago

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