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
 
Numeric value EDIT problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Thu Jun 28, 2007 2:13 pm    Post subject: Numeric value EDIT problem
Reply with quote

Hi,

I have declared one pic clause in the working storage section that is EMP ID PIC 9(6).

EMP id's in the in the input file:

000001
000012
000113
001111

I want to get the below values in the output file. Can you tell me is there any command to get only values instead of getting value with ZERO's

1
12
113
1111

Thanks,
Suresh
Back to top
View user's profile Send private message

UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Thu Jun 28, 2007 2:20 pm    Post subject:
Reply with quote

Hi !

Use specific masks for your output fields.

Examples:


01 ZNUM-1206 PIC +++++++++++9,999999.
01 ZNUM-1602 PIC +++++++++++++++9,99.
01 ZNUM-1800 PIC ZZZZZZZZZZZZZZZZZ9.
01 ZNUM-0400 PIC ZZZ9.
01 ZNUM-1000 PIC 9(10).
01 ZNUM-0800 PIC 9(08).
01 ZNUM-08BB PIC 999B999B99.


Regards, UmeySan
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Jun 28, 2007 2:29 pm    Post subject:
Reply with quote

UmeySan,

Using mask, how would you do left alignment for a numeric value?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jun 28, 2007 3:01 pm    Post subject:
Reply with quote

There is no "command".
Use a perform loop with RM and "squeeze" out the blanks.
Back to top
View user's profile Send private message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Thu Jun 28, 2007 3:28 pm    Post subject: Re: Numeric value EDIT problem
Reply with quote

I think Umeysan solution is works fine. I have found one PIC clause in the report program that one is to display the page number on report

05 WS-I-PAGE PIC ZZZ9.

AS per the above PIC the page number start with 1 and that range goes upto 9999.

Thanks Umeysan...


Suresh
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jun 28, 2007 3:42 pm    Post subject:
Reply with quote

Not
Code:
1
12
113
1111
but
Code:
   1
  12
 113
1111
Suckered again..... icon_redface.gif
Back to top
View user's profile Send private message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Fri Jun 29, 2007 3:31 pm    Post subject: Hi William
Reply with quote

Can you give the sysntax to get the format as you mentioned above. I don' have an idea .

Thanks,
Suresh
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

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