View previous topic :: View next topic
|
Author |
Message |
rohit_raajin
New User
Joined: 10 May 2005 Posts: 10 Location: india
|
|
|
|
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 |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
A similar question has been posted before. Check this topic and adjust to your needs. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
rohit_raajin
New User
Joined: 10 May 2005 Posts: 10 Location: india
|
|
|
|
The rest of the bytes will have trailing spaces. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
adarsha
New User
Joined: 28 Dec 2006 Posts: 8 Location: Noida,Delhi
|
|
|
|
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 |
|
|
|