View previous topic :: View next topic
|
Author |
Message |
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
Hi All,
I have got a requirment,
i will file from external system, in which part of the data represents date, and it is in internal form (i.e s9(4) comp) , now i need to convert that from computational form to normal display form before processing.
please let me know thanks in advance
regards
jayaram |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Please let us know what the date format is in the comp field, wnd what the format is that you want in display form.
Thanks, |
|
Back to top |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
DavidatK wrote: |
Please let us know what the date format is in the comp field, wnd what the format is that you want in display form.
Thanks, |
date is in internal form for 26jul05 it stores as D2CF, and the output required format is ccyy-mm-dd. please let me know .
thanks
jai |
|
Back to top |
|
|
krishnaiahc
New User
Joined: 31 Aug 2005 Posts: 21
|
|
|
|
Hai,
Date will come at least 6 digits (yymmdd). 6 charaters are not fit into S9(4) comp.
I think it may 1 word, ie s9(9) comp. If yes you have to follow below process:
1. find out which date format is coming (YYYYMMDD/YYMMDD)
2. According define the variable with numeric data item pic (i.e s9(8) /s9(6) ) move internal form to numeric data item.
3. for Example YYYYMMDD, Defind the working storange Non-numeric variable with length of numeric data + 2 ( YYYY-MM-DD).
4. the above Non-numeric data defination need to be
05 DATA-DISP
10 YEAR PIC X(4).
10 FILLER PIC X(1).
10 MONTH PIC X(2).
10 FILLER PIC X(1).
10 DATE PIC X(2).
MOVE CORRESPONDING FILELD TO NON-NUMERIC DATA ITEM.
Please let me know if you have any issue.
thanks,
Krishna |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
Jai,
I still have some confusion of the comp date format. When the hex value x?D2CF? is converted to decimal it is 53967. This doesn?t represent anything to me.
Can you please elaborate on the format and how you get 26jul05 from this?
Is it truly a 9(4) COMP (2 bytes) or a 9(8) COMP (4 bytes).
Let us know,
Thanks,
|
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Jai,
The max number you can store in a 9(4) comp field is 65535. If it's S9(4) the max nbr is 32767 because the hi order bit is reserved for the sign.
You'll have to go with 9(6) comp. That requires 4 bytes of memory. What's the size of the field being sent? |
|
Back to top |
|
|
|