+ Reply to Thread
Results 1 to 9 of 9

Thread: Moving the *DATE to an *USA date field in FREE FORMAT

  1. #1

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    Check the built in function %Date. Today = %Date();

  2. #2
    Guest.Visitor Guest

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    Thanks. The %date BIF worked. But on another subject related to BIFs , I am getting compile errors trying to move a character field to a numeric field. This is in FREE FORMAT also. The character fields come into the program as parameters, as follows: C *ENTRY PLIST C PARM PFYYYY 4 C PARM PTrk# 6 C PARM PReg# 7 The Numeric fields are screen fields described as follows: A SFYYYY 4Y 0B 8 50DSPATR(UL) A EDTCDE(Z) A STRK# 6Y 0B 8 55DSPATR(UL) A EDTCDE(Z) A SREG# 7Y 0B 9 45DSPATR(UL) A EDTCDE(Z) I know that I can do a straight move statement if I am not using FREE FORMAT, but the boss wants to go the FREE FORMAT way. I tried the following statements, but got compiler errors: SFYYYY = PFYYYY; STrk# = PTrk#; SReg# = PReg#; and also SFYYYY = %dec(PFYYYY); STrk# = %dec(PTrk#); SReg# = %dec(PReg#); Can you tell me how to move the character fields to the numeric fields??

  3. #3

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    here is an example of a program that i wrote and occasionally add lines to to watch in debug, to see what happens. -sarge
    Code

  4. #4
    Guest.Visitor Guest

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    Daniel Bizon wrote: > SFYYYY = PFYYYY; > STrk# = PTrk#; > SReg# = PReg#; > and also > SFYYYY = %dec(PFYYYY); > STrk# = %dec(PTrk#); > SReg# = %dec(PReg#); > Can you tell me how to move the character fields to the numeric > fields?? Daniel, You have to define the length and decimal places: SFYYYY = %Dec(PFYYYY:4:0) ; Bill

  5. #5

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    Pat Landrum wrote: > Check the built in function %Date. > > Today = %Date(); %Date() returns the system date; *DATE is the job date. Chances are that Daniel does really want the system date anyway, but if not, the correct way to get *DATE in a date field is to use Today = %Date(*DATE);

  6. #6
    lucaguatieri Guest

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    you can also use "atoi" function of C language... bye
    Code

  7. #7

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    Another thing is leading zeros. If you need them to appear exactly in a character field, use the following: SFYYYY = %Editc(PFYYYY:'X');

  8. #8
    Guest.Visitor Guest

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    Can someone tell me how to move the *DATE system value to a D-Spec field that is described as *USA ?? I'm using free format RPG coding. I tried the following statements but got compiler errors. Today = *Date; Today = %Dec(*Date); The D-Spec field is: D Today S D DATFMT(*USA) INZ

  9. #9
    Guest.Visitor Guest

    Default Moving the *DATE to an *USA date field in FREE FORMAT

    If all you want to do is get the system date into a date field you can define the field and initialize it to the system date D Today S D DATFMT(*USA) INZ(*SYS) puts the system date into the field and it is in USA Format too.

+ Reply to Thread

Similar Threads

  1. Subtract Date Duration in Free Format
    By dolfan in forum RPG
    Replies: 2
    Last Post: 10-03-2005, 06:15 AM
  2. Moving a date defined field to a numeric field using free format
    By buck.calabro@commsoft.net in forum General
    Replies: 2
    Last Post: 05-25-2004, 02:00 AM
  3. Free Format Date Test
    By Guest.Visitor in forum RPG
    Replies: 2
    Last Post: 04-13-2004, 11:31 AM
  4. Replies: 7
    Last Post: 07-03-2003, 11:33 AM
  5. Moving numeric field to date data type field.
    By Guest.Visitor in forum Application Software
    Replies: 19
    Last Post: 08-20-2000, 04:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts