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
 

 

How to split a variable values?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Mon Mar 23, 2009 2:20 pm    Post subject: How to split a variable values?
Reply with quote

Hi

I Have a variable with value '2020010902056100118A51A5100'
how can i split this value in following format using rexx.
a=2020
b=001
c=090205
d=61
e=00118
f=A51
g=A51
h=00

Please sugesst.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Mar 23, 2009 2:33 pm    Post subject:
Reply with quote

What is the logic behind your split? Is it location-dependent? Value-dependent?

O.
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Mon Mar 23, 2009 2:41 pm    Post subject:
Reply with quote

This is an alpha numeric value, it can be a complete numeric values.
when it is a completely numeric value the split can be done simply dividing the data by 1000.... but some times the value comes in alpha numeric then my logic wont work instead an error is thrown.

And the length of the data is constant. I need a logic how to split the alpha numeric data into several variables. Like variable "a" has first four numbers of the data then variable "b" has next 3 data like wise.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Mon Mar 23, 2009 2:46 pm    Post subject: Reply to: How to split a variable values?
Reply with quote

Code:
v = "2020010902056100118A51A5100"
/*   12345678901234567890123456789
parse var v a 5 b 7 c 13 d 15 e 20 f 23 g 26 h

say "a=" a
say "b=" b
say "c=" c
say "d=" d
say "e=" e
say "f=" f
say "g=" g
say "h=" h
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Mon Mar 23, 2009 2:47 pm    Post subject:
Reply with quote

Thanks Enrico
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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