Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

COBOL digits allocation problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: COBOL digits allocation problem
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: 464

PostPosted: Fri Aug 19, 2005 1:25 pm    Post subject: Re: COBOL digits allocation problem
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us