APT_STRING_PADCHAR override at job level not working

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
nikhil_bhasin
Participant
Posts: 50
Joined: Tue Jan 19, 2010 4:14 am

APT_STRING_PADCHAR override at job level not working

Post 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.
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

Are you adding the APT_STRING_PADCHAR variable in one job (say your transform job) and loading using a different job?
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post 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.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
nikhil_bhasin
Participant
Posts: 50
Joined: Tue Jan 19, 2010 4:14 am

Post 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 :(
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post 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 ' ' ?
Arun
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post 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.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
nikhil_bhasin
Participant
Posts: 50
Joined: Tue Jan 19, 2010 4:14 am

Post 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
Klaus Schaefer
Participant
Posts: 94
Joined: Wed May 08, 2002 8:44 am
Location: Germany
Contact:

Post by Klaus Schaefer »

If it is EBCDIC, you may try '0x40' as padchar...
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply