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

COBOL digits allocation problem


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

New User


Joined: 12 Mar 2005
Posts: 13
Location: hyderabad

PostPosted: Fri Aug 19, 2005 10:58 am
Reply with quote

my query is

we have 6 digits and 6 bytes date field, but I want to accomodate it into 3 bytes with 6 digits.

don't say use comp-3, because that contains sign....

by
prasad yadav
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Fri Aug 19, 2005 1:25 pm
Reply with quote

Hi Prasad,

To allocate 6 digit into 3 byte comp-3 is best oprtion in numeric field

Regards
Rupesh
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Aug 21, 2005 12:56 am
Reply with quote

You need 4 bytes to accomodate a 6 digit date in COMP-3 format. All that aside, the Y2K frenzey should point us toward 8 digit dates.
Back to top
View user's profile Send private message
Carl-B

New User


Joined: 17 Sep 2005
Posts: 1

PostPosted: Sat Sep 17, 2005 2:56 am
Reply with quote

icon_biggrin.gif
Setup an 88 section similar to:
*01 WS-1BYTE PIC X.
* 88 x00 VALUES X"00".
* etc
* etc
* 88 x22 VALUES X"22".
* etc
* etc

Then use a perform loop. Drop 1 character into WS-1BYTE
Use an EVALUATE WS-1BYTE
and list the WHEN's.
You will have to setup an 88 for each possible value (00 thru 99). But eventually you will have the logic to map the hex-decimal to decimal.
Use your imagination. You will see the answer.

Carl.
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 Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top