Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us