Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
mpawan
Warnings : 2

New User

Joined: 03 Nov 2008
Posts: 42
Location: Pune

 Posted: Mon Mar 23, 2009 2:20 pm    Post subject: How to split a variable values? 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.

ofer71

Global Moderator

Joined: 27 Dec 2005
Posts: 2360
Location: Israel

 Posted: Mon Mar 23, 2009 2:33 pm    Post subject: What is the logic behind your split? Is it location-dependent? Value-dependent? O.
mpawan
Warnings : 2

New User

Joined: 03 Nov 2008
Posts: 42
Location: Pune

 Posted: Mon Mar 23, 2009 2:41 pm    Post subject: 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.
enrico-sorichetti

Global Moderator

Joined: 14 Mar 2007
Posts: 10457
Location: italy

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

 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
mpawan
Warnings : 2

New User

Joined: 03 Nov 2008
Posts: 42
Location: Pune

 Posted: Mon Mar 23, 2009 2:47 pm    Post subject: Thanks Enrico
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am attchmvs from rexx subroutine that re... harisukumaran CLIST & REXX 1 Fri Jan 19, 2018 5:29 am Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us