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: 7936
Location: Bellevue, IA

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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts help: convert C'00AB' to X'00AB' alan_gu DFSORT/ICETOOL 1 Thu Sep 29, 2016 12:22 pm


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