×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Change alpha field to date field

Change alpha field to date field

Change alpha field to date field

(OP)
DEFINE FILE
COMP_DT/YYMD = EDIT(WRK_DTM);
ORG_SCH/YYMD = EDIT(ORG_WNT);
END

It doesn't like my field conversion!!! Am I using the right one?

RE: Change alpha field to date field

(OP)
Sorry I meant to write
DEFINE FILE tablename
COMP_DT/YYMD = EDIT(WRK_DTM);
ORG_SCH/YYMD = EDIT(ORG_WNT);
END

RE: Change alpha field to date field

If WRK_DTM were defined as, for example, A8YYMD, then:

COMP_DT/YYMD = WRK_DTM;

should work.

RE: Change alpha field to date field

(OP)
WRK_DTM and ORG_WNT are A12 format, and I want these two fields to convert into DATE (YYMD)

RE: Change alpha field to date field

What is in the A12 positions?

RE: Change alpha field to date field

(OP)
The thing is that this field capture time as well..But I've already extracted the time out, so what left is only the date which is like 20031112

RE: Change alpha field to date field

Cool, then you're almost there. Try:

WORK_DTM/A8YYMD=EDIT(WRK_DTM,'99999999$$$$');
COMP_DT/YYMD = WORK_DTM;

if the date is left justified in the 12 byte field. If not, adjust the position of the 9's.
 
 

 

RE: Change alpha field to date field

(OP)
That works!!!  Why do we have to put the A8 in front of it???

RE: Change alpha field to date field

Because you want to tell Focus what type and size the field is.

RE: Change alpha field to date field

Sorry, maybe that was too brief. You don't have a date field, you have an 8 byte alpha field. The YYMD just tells Focus how to format it if it prints it. Fortunately, it also tells Focus how to decode it if you want to set up a real date field.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close