Page 1 of 1

APT_STRING_PADCHAR override at job level not working

Posted: Tue Jul 23, 2013 1:50 am
by nikhil_bhasin
Hi Everyone,
I am facing an issue while using APT_STRING_PADCHAR variable at job level. Actually at project level, the value is default '0x0', and when i set it to 0x20 at job level by adding it to job parameters, it still pads the character column values with nulls (0x0). Not sure why it is happening. I tried searching forum but, I could not find any relevant post.

Posted: Tue Jul 23, 2013 5:38 am
by jerome_rajan
Are you adding the APT_STRING_PADCHAR variable in one job (say your transform job) and loading using a different job?

Posted: Tue Jul 23, 2013 9:54 am
by ArndW
I'd also look at the job log at one of the first entries per run which shows all of the environment variable settings - check to see that your pad character is actually being set as you expect.

Posted: Tue Jul 23, 2013 12:35 pm
by asorrell
I have to agree with jerome - I've seen this before at another site. Remember that once any DataStage job touches the data, it will pad short fields with the PADCHAR immediately. If you change the PADCHAR later it is too late, the data has already been padded, and it won't perform a substitution.

Posted: Tue Jul 23, 2013 10:02 pm
by nikhil_bhasin
I have added the padchar variable to all the jobs right from the start of the reading of source file (which is ebcdic). Even doing so, gives me nulls as padchar.

@ArndW - Yes, that was the first thing i did, the variables how '0x20' as padding character.

Actually the same set of jobs run in 8.1 (where padchar is defined as '0x20' at project level) and there it gets padded with spaces

SO not sure what I am missing in 8.7, ideally job level override should have worked :(

Posted: Wed Jul 24, 2013 1:45 am
by arunkumarmm
Just out of curiosity. All the EBCDIC files are fixed width, isnt it? Where do you actually get this padchar issue?

And also, did you try giving the value for "APT_STRING_PADCHAR" as ' ' ?

Posted: Thu Jul 25, 2013 2:59 pm
by asorrell
Make sure that someone didn't insert the $APT_STRING_PADCHAR environment variable into one of the upstream jobs before you changed the setting.

When an environment variable is inserted into a job it puts the default to the current setting at the time it was inserted. If it wasn't changed to $PROJDEF it isn't picking up your changes.

Posted: Mon Jul 29, 2013 1:19 am
by nikhil_bhasin
Yes, EBCDIC files are fixed length, I am getting this issue after reading them and loading them into teradata tables. I did try ' ' as padchar

Posted: Mon Jul 29, 2013 6:07 am
by Klaus Schaefer
If it is EBCDIC, you may try '0x40' as padchar...

Posted: Thu Aug 01, 2013 4:32 am
by priyadarshikunal
I have seen people defining the job parameter instead of calling the environment variable. Make sure you are calling $APT_STRING_PADCHAR, the $ should be visible in the parameter list in job properties. Also it only affects the CHAR fields.

Also make sure the input is not padded by 0x0 in the source file itself. Have a look at it using any hex editor.