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
 
moving a variable to a host variable

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

New User


Joined: 23 Mar 2006
Posts: 13

PostPosted: Wed Sep 20, 2006 9:23 am    Post subject: moving a variable to a host variable
Reply with quote

I have a variable with picture clause of X(4).
I want it to be moved to a host variable with picture clause of pic s9(9) comp.

is it possible
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1250
Location: Israel

PostPosted: Wed Sep 20, 2006 12:58 pm    Post subject:
Reply with quote

The easiest way is to define the variable as a group field:
Instead of:
Code:
03  MY-VAR  PIC X(4).

Define:
Code:
03  MY-VAR.
    05  MY-VAR-9 PIC 9(4).

Like this, MY-VAR stays the same (alpha field, length 4), and you can use MY-VAR-9 to move it to any comp or comp-3 field.
Don't forget to ask IF MY-VAR IS NUMERIC before!
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 Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

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