Move data from OHPODT to DSORDD

265 pts.
Tags:
AS/400
DSORDD
RPG ILE
I have a field in PF OHPODT 7 0 one more field in other PF DSORDD 8 A. I need to move data from OHPODT to DSORDD in dateformat(CCYYMMDD). I am not sure about dateformat in OHPODT, but in this field I can see only 0 value. Please advise me in RPGILE how to solve this.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

Can you not find out how the field OHPODT is populated. Probably there should be a logic in some program which populates this field. This should give you an idea of the format.

I am guessing: Based on the field length being 7,0 i think this might be a CYYMMDD format. The First digit could be the ’1′ or ’0′. This might have come into existence because of some Y2K conversion where all the dates whose year part is greater than 40 were tagged as 0 and for those dates whose year is less than 40 tagged as 1.

I might be wrong as well. So the best thing would be to find out which of the programs populate this field and then look at the logic to identify the format.

Discuss This Question: 11  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Askt
    yes. but i need to convert date fromat from OHPODT(CYYMMDD) to DSORDD(CCYYMMDD) please advice me in rpgile how to overcome.
    265 pointsBadges:
    report
  • Gilly400
    Hi, Add 19000000 to your 7 long (CYYMMDD format) field, this will give you CCYYMMDD format. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Askt
    can you tell me brief after that which built in function use in rpgile... please advice..
    265 pointsBadges:
    report
  • Askt
    I tryed but still getting error DDT@1 S 7P 0 INZ(1090403) D*DT@1 S 7P 0 INZ(19000000) DDT@2 S 8A C C EVAL DT@2 = %Int( %Char(DT@1 : *ISO0 ) ); C seton *lr
    265 pointsBadges:
    report
  • Gilly400
    Hi, Try this :- C EVAL DT@2 = %Char(DT@1 : *ISO0 ); or C EVAL DT@2 = %Char(DT@1 + 19000000); Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Askt
    when i am trying first one C EVAL DT@2 = %Char(DT@1 : *ISO0 ); getting error: two many parathesis in builtin function when i am trying sencond one C EVAL DT@2 = %Char(DT@1 + 19000000); getting error : token is not valid please advice..
    265 pointsBadges:
    report
  • graybeard52
    Try this instead. Eval DT@2 = %char(%date(DT@1:*cymd):*iso0) This converts the 7 digit numeric to a date field, then converts the date to a char field.
    3,115 pointsBadges:
    report
  • Askt
    yes i tried but stil error.. token is invalid..
    265 pointsBadges:
    report
  • YuVa47
    Hi, you can try this one: DT@2 = %dec(%char(%date(DT@1:*cymd):*iso0):8:0); Have a great day
    1,300 pointsBadges:
    report
  • graybeard52
    Askt, Are you on an old release of the OS ?
    3,115 pointsBadges:
    report
  • Yorkshireman
    I'm guessing you're not a programmer by profession? Start by checking the release of i5/os you are using. This is given at the top of the compiler listing. Go to the IBM website for manuals for this operating system release, and read or download the 2 RPG Manuals. Check the sections which explain date data typing and the conversion between. The suggestions so far have all been valid, so if you are getting errors it is your implementation / lack of knowledge about the data you seek to manipulate. You say that all of the data fields are zero? Use FNDSTRPDM over your source files to search for occurrences of that data field, and examine the code where any are found as the target of an EVAL or move. Also check for any instances where the file is used as an output file, and examine for any indirect update of the field. Unless you *know* what the data values are you have absolutely no, zero, nil, chance of producing code which will do what you only vaguely guess may be the requirement. Your bosses need to know this. "Build a bridge!" - makes no sense unles you are also told where from and where to. You only know where to. Once you've looked in the manuals you'll be well equipped to come up with a solution. Yorkshireman
    5,580 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following