Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Formatting?

Former Member
0 Likes
601

Hi Experts,

I dont know that How the User sends me the DATE format in flat file! I mean, some times, DD.MM.YYYY or MM/DD/YYYY or DDMMYYYY or MMDDYYYY, but I wanna to pass it as External format to CONVERT_DATE_INTERNAL to get the Internal format as YYYYMMDD.

So, How to chnage,

DD.MM.YYYY ---> DDMMYYYY

or MM/DD/YYYY -


>MMDDYYYY?

or some times, user sends as 8 CHARs only, with out specila chars!

(its is not recommended to use OFFSETTING)

thanq.

Message was edited by:

Srikhar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
519

Sorry i did not read your message properly.

User should maintain date format properly in file it self,if not then

you need to write the logic before using FM.

Simple logic :

if data ca '/' .

do not write any logic

else.

here you need to use concatenate command

endif.

Thanks

Seshu

3 REPLIES 3
Read only

Former Member
0 Likes
519

Hi Srikhar

Get the string length of the date field that user is sending using the function strlen(). If it is 8 chars no need to do anything, else you can use the edit mask option with the write statement with mask as '__ __ ____', then use condense option on that string with no-gaps addition. That should give the date without any special chars.

~Ranganath

Read only

Former Member
0 Likes
519

Use FM - CONVERT_DATE_TO_INTERN_FORMAT

If you use above fm then it will convert into default user date format.

Let me know if i am wrong.

Thanks

Seshu

Read only

Former Member
0 Likes
520

Sorry i did not read your message properly.

User should maintain date format properly in file it self,if not then

you need to write the logic before using FM.

Simple logic :

if data ca '/' .

do not write any logic

else.

here you need to use concatenate command

endif.

Thanks

Seshu