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
 

 

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: 743
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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm


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