IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

conversion of computational data to normal form


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Dec 06, 2005 9:28 pm
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Dec 06, 2005 9:39 pm
Reply with quote

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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Tue Dec 06, 2005 9:56 pm
Reply with quote

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
View user's profile Send private message
krishnaiahc

New User


Joined: 31 Aug 2005
Posts: 21

PostPosted: Tue Dec 06, 2005 10:30 pm
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Dec 06, 2005 11:22 pm
Reply with quote

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. icon_confused.gif

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,
icon_smile.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Dec 07, 2005 4:54 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
Search our Forums:

Back to Top