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
 

 

Justification of Alphanumeric variable with Numeric data

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

New User


Joined: 10 May 2005
Posts: 10
Location: india

PostPosted: Thu Jan 04, 2007 3:13 pm    Post subject: Justification of Alphanumeric variable with Numeric data
Reply with quote

I have a Alphanumeric variable of X(25), In which variable values can come. Suppose value 1234567890 comes , i have to pick only last 4 digits of this incoming variable and mask the rest with "*" .
it should be like ******7890and rest spaces.

Can anyone help me what code i should use ?
Back to top
View user's profile Send private message

Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1105
Location: The Netherlands at Hole 19

PostPosted: Thu Jan 04, 2007 3:35 pm    Post subject:
Reply with quote

A similar question has been posted before. Check this topic and adjust to your needs.
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 Jan 04, 2007 3:36 pm    Post subject:
Reply with quote

OK, you explain that the field is 25 bytes long and might have a 10 digit number in it. what else fills out the other 15 bytes, leading or trailing blanks?
Additionally, you imply that sometimes the number might be different lengths, correct?
Back to top
View user's profile Send private message
rohit_raajin

New User


Joined: 10 May 2005
Posts: 10
Location: india

PostPosted: Thu Jan 04, 2007 3:44 pm    Post subject:
Reply with quote

The rest of the bytes will have trailing spaces.
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 Jan 04, 2007 3:54 pm    Post subject:
Reply with quote

Assuming the number has no leading or imbeded blanks, something like:
unstring inarea into outarea delimited by space count in cnt followed by move all '*' to outarea (1:cnt-4) should do it.
Back to top
View user's profile Send private message
adarsha

New User


Joined: 28 Dec 2006
Posts: 8
Location: Noida,Delhi

PostPosted: Thu Jan 04, 2007 5:31 pm    Post subject: Re: Problem with Alphanumeric variable.
Reply with quote

rohit_raajin wrote:
I have a Alphanumeric variable of X(25), In which variable values can come. Suppose value 1234567890 comes , i have to pick only last 4 digits of this incoming variable and mask the rest with "*" .
it should be like ******7890and rest spaces.

Can anyone help me what code i should use ?


hi,

Its Adarsh,

according ur requirement i can guess that, u need one more variable say Var2, declared with sign clause and no *'s u need in Value clause..

then use reference modification
Move Var1(start Pos;end Pos) to Var2...!!!!
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 Paasing symbolic parameter to instrea... Anirudh Anand JCL & VSAM 0 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts Passing data from REXX to C programme... chong.zhou All Other Mainframe Topics 0 Wed Jul 26, 2017 4:55 pm
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 8 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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