Hi, Thanks for the quick response. The &TOFILE did exist, so I deleted it and executed the create and cpytoimpf again. Can you tell me how to get the system QCCSID please?
The table is created by the rpg pgm. I am doing a create statement via sql:
C/EXEC SQL
C+ CREATE TABLE MYTABLE AS
C+ (SELECT
C+ KEY_NUMBER,
C+ STATUS,
C+ PACKED_6,
C+ CASE WHEN LENGTH(TRIM(CHAR(PACKED_6)
C+ '0' CONCAT LEFT(TRIM(CHAR(PACKED_6)),
C+ WHEN LENGTH(TRIM(CHAR(PACKED_6)
C+ LEFT(TRIM(CHAR(PACKED_6)),
C+ ELSE NULL
C+ END AS COLUMN0000
C+ FROM
C+ FILEA,
C+ FILEB
File Definition from the create statement above:
Field
Name Type Length Dec
KEY_NUMBER S 10 0
STATUS A 1
PACKED_6 P 6 0
COLUMN0000 A 9
The PACKED_6 is really a date shown like this: 112108. They want it formatted as this: 11/21/2008, but they want both columns downloaded. Now that I take a closer look, I am getting the 112108 (which is the packed field) and it is unpacking it nicely... I am not getting the 11/21/2008 date. It is showing like this: ñðñùð÷
Here's my output from greenscreen (the downloaded .csv is the same too)
1111111111 0 101907 ñðñùð÷
2222222222 0 62508 ðöòõðø
3333333333 0 121208 ñòñòðø
4444444444 0 71608 ð÷ñöðø
5555555555 1 52609 ðõòöðù
6666666666 0 102907 ñðòùð÷
7777777777 0 52008 ðõòððø
8888888888 1 21909 ðòñùðù
9999999999 0 70609 ð÷ðöðù
1111111112 0 110807 ññðøð÷
1111111113 0 92507 ðùòõð÷
1111111114 0 62909 ðöòùðù
1111111115 1 42607 ðôòöð÷
Main Topics
Browse All Topics





by: tliottaPosted on 2009-10-26 at 15:05:18ID: 25667437
MsDeveloper:
It always unpacks for me regardless of OS version/release. (There are always possible PTFs that might be involved.) Multiple possibilities might influence the result --
Does &TOFILE exist before CPYTOIMPF is executed? If so, what attributes are assigned to the file?
What is the system QCCSID value? What is the definition of the column in the SQL table? Can you show a simple green-screen query of a few rows of the SQL table? If the table is created by the RPG program, how is data inserted into the rows?
Nothing jumps out to me as the most likely cause. A few questions/answers should narrow things down.
Tom