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

Numeric value EDIT problem


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 771
Location: Germany

PostPosted: Thu Jun 28, 2007 2:20 pm
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: 1436
Location: Bangalore,India

PostPosted: Thu Jun 28, 2007 2:29 pm
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: 3156
Location: Tucson AZ

PostPosted: Thu Jun 28, 2007 3:01 pm
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
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: 3156
Location: Tucson AZ

PostPosted: Thu Jun 28, 2007 3:42 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Need help to resolve a hard edit COBOL Programming 8
Search our Forums:

Back to Top