Schema File with fixed length issue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sirishds
Participant
Posts: 18
Joined: Sat Jun 12, 2010 11:28 pm

Schema File with fixed length issue

Post by sirishds »

I have a schema file of fixed length.

Schema file is as follows:
record
{record_length=fixed,delim=none}
(
field1:nullable string[1] {width=1};
field2:nullable string[10] {width=10};
field3:nullable string[1] {width=1};
field3:nullable string[3] {width=3};
:nullable string[1] {width=1};
:nullable string[10] {width=10};
:nullable string[10] {width=10};
P_CD:nullable string[4] {width=4};
B_STS_CD:nullable string[1] {width=1};
SIGN:nullable string[1] {width=1};
T_NUM:nullable string[9] {width=9};
CREAT_DT:nullable string[10] {width=10};
SRC_CD:nullable string[4] {width=4};
GL_ACCT_A_NBR:nullable string[5] {width=5};
B_NBR:nullable string[5] {width=5};
D:nullable string[3] {width=3};
B_CD:nullable string[3] {width=3};
GL_BU:nullable string[5] {width=5};
GL_BUS:nullable string[5] {width=5};
CUST_A_NBR:nullable string[7] {width=7};
CUST_B_NBR:nullable string[7] {width=7};
GL_FIN__CD:nullable string[2] {width=2};
GL1_CD:nullable string[2] {width=2};
GL_CD:nullable string[4] {width=4};
GL:nullable string[4] {width=4};
T:nullable string[10] {width=10};
DT:nullable string[10] {width=10};
ID:nullable string[10] {width=10};
C_A_NBR:nullable string[4] {width=4};
GL_LO:nullable string[4] {width=4};
GL_AMT_SIGN:nullable string[1] {width=1};
GL_MNTY__NUM:nullable decimal[13,2] {width=13};
GL_MNTY_B_AMT_SIGN:nullable string[1] {width=1};
GL_MNTY_B:nullable decimal[13,2] {width=13};
GL_PRDCT_A_CD:nullable string[3] {width=3};
GL_PRDCD:nullable string[3] {width=3};
GL_REIN:nullable string[2] {width=2};
GL_REIN:nullable string[2] {width=2};
GL_SRS:nullable string[8] {width=8};
GL_SRS_DESG_B_CD:nullable string[8] {width=8};
GL_ZBA_A_NBR:nullable string[14] {width=14};
GL_ZBA_B_NBR:nullable string[14] {width=14};
MINOR_M:nullable string[8] {width=8};
OHBS_CLI:nullable string[2] {width=2};
OHBS_NBR:nullable string[8] {width=8};
OHBS__ST_CD:nullable string[2] {width=2};
OLOB_ID:nullable string[4] {width=4};
SUB_GRP_NBR:nullable string[4] {width=4};
OCHRG_DT:nullable string[10] {width=10};
ORIG_CCC:nullable string[2] {width=2};
PAY_TYP_CD:nullable string[1] {width=1};
PCR_AMT_SIGN:nullable string[1] {width=1};
PCR_AMT_NUM:nullable decimal[9,2] {width=9};
PHS_MKT_SEG_CD:nullable string[2] {width=2};
PROV_PRS_CD:nullable string[1] {width=1};
PS9_GL_AC_NBR:nullable string[5] {width=5};
PS9_G_NBR:nullable string[5] {width=5};
PT_A_NBR:nullable string[7] {width=7};
PS9_GL_CUR:nullable string[7] {width=7};
PT_A_CD:nullable string[6] {width=6};
PS9_GL_DEPT_B_CD:nullable string[6] {width=6};
PA_CD:nullable string[5] {width=5};
P_CD:nullable string[5] {width=5};
PS9_NBR:nullable string[8] {width=8};
PS9_GL_LOC_B_NBR:nullable string[8] {width=8};
PS9_GL_CD:nullable string[6] {width=6};
B_CD:nullable string[6] {width=6};
PS9_GL_PROJ_A_ID:nullable string[10] {width=10};
PS9_GL_PROJ_B_ID:nullable string[10] {width=10};
PINS_A_CD:nullable string[2] {width=2};
PS9INS_B_CD:nullable string[2] {width=2};
PL_SEG_A_CD:nullable string[5] {width=5};
PS_CD:nullable string[5] {width=5};
RECV_FLG_CD:nullable string[1] {width=1};
REIM_TYP_CD:nullable string[2] {width=2};
RPS_FISCAL_DT:nullable string[10] {width=10};
RVRS_CORR_CD:nullable string[1] {width=1};
SHR_ARNG_CD:nullable string[2] {width=2};
field86:nullable string[1] {width=1};
field87:nullable string[3] {width=3};
field88:nullable string[2] {width=2};
)

and the corresponding data file is as follows:

DFI 2014-06-202014-06-2020140620501000092014-06-19141700000600 TNCLPDN2014-06-20799785 09X8444 2014-05-012014-05-01DBPCL0620 +00000000017.00-00000000017.000200Y PPO0000000160001-01-01FA10001CE0001518 INO 2014-06-20P012014-06-01O1007 09X8205 D005MSMSNCLMPD0 0 50000022653529 RP RP 000000605046 2 YYYNN3 38601 000007127919 187 2014-05-17 E 51S 8540000 2014-03-019999-12-31 38746916 38746916 000000335320USAMS80910820922001000000300000033532030100USAMS809USAMS809108209108209 27200072006129126129125059020194

while running job i am getting an error as

Bad record delimiter after fixed-length record: expected "
", got " "

Itought itis because of the fixed width length. the first field(field1) wich is declared as 1,which is supposed to be 3.even on making it as 3 i am getting the same erroe and as per mapping document the string value of the first field (field1) is 1.


Can someone helpme on this.

Thanks in advance.

Sirish.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Double check your schema file. It looks like field3 is named twice, then after that 3 fields are not named.
Choose a job you love, and you will never have to work a day in your life. - Confucius
sirishds
Participant
Posts: 18
Joined: Sat Jun 12, 2010 11:28 pm

Post by sirishds »

Thank you for responding.

The issue is resolved now.It looks like the fixed length schema and the length of the data in the file doesnot match.because of which the data was not getting populated.

Cheers,
Sirish.
Post Reply