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 Sorting group data rajella DFSORT/ICETOOL 3 Sun Jan 22, 2017 11:32 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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