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
 

 

Convert '00n' to 'n<space><space>'

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

New User


Joined: 02 Jul 2009
Posts: 14
Location: Mumbai

PostPosted: Mon Sep 13, 2010 7:26 pm    Post subject: Convert '00n' to 'n<space><space>'
Reply with quote

Hi,

I have a variable A PIC 9(03) which can have values from 001 to 100. I want to move this field to B defined as PIC X(03). The moved value in field B should be displayed left aligned like from "1 " to "100".

For example if A = 001, B should have value '1<space><space>'.

Please suggest.

Ankit
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8121
Location: East Dubuque, Illinois, USA

PostPosted: Mon Sep 13, 2010 7:35 pm    Post subject:
Reply with quote

Reference modification works well:
Code:
           IF  A < 10
               MOVE A (3 : 1)          TO  B
           ELSE
               IF  A < 100
                   MOVE A (2 : 2)      TO  B
               ELSE
                   MOVE A              TO  B
               END-IF
           END-IF.
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 Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am


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