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
 

 

Split a RECORD into different variables

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

New User


Joined: 08 Mar 2009
Posts: 10
Location: Hyderabad

PostPosted: Mon Apr 27, 2009 12:41 am    Post subject: Split a RECORD into different variables
Reply with quote

Hi,

I am trying to split a variable block record into different variables by using PARSE ,but getting a different value in one of the field(VAR3) icon_redface.gif

My input file (with hex on)
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
UDAY1111111  p-k 02YN    ¬0714     ±AAA3AAA3                           
ECCEFFFFFFF409691FFED00125FFFF000008CCCFCCCF0444000004444444440000044444
4418111111101702F02852001F071400000F111311130000000000000000000000000000


Trace ouput for REXX code is
Code:

 *-*  PARSE VAR   RESULT.I VAR1 +4 VAR2 +30 VAR3 +2 VAR4
 >>>    "UDAY"                                         
 >>>    "1111111 ?p-k?02YN????¬0714????"               
 >>>    "?:"                                           
 >>>    "AAA3AAA3?   ?????         ?????               
       00000100"   


VAR3 is hexadecimal value X'008F' at 35th & 36th position .but im getting "?:" value. icon_eek.gif icon_confused.gif

Can i use the PARSE statement for spliting a record into variables of different data types?IF yes/no please help me

Is there any other method of doing the same. icon_question.gif

I am expecting hexa decimal value at 35th and 36th positions of Input file to be in VAR3 variable. icon_smile.gif
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Mon Apr 27, 2009 1:57 am    Post subject: Reply to: Split a RECORD into different variables
Reply with quote

You are getting the hex!

after parsing use the C2X function to convert to a displayable format

for example C2X("0") ==> F0
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Apr 27, 2009 2:01 am    Post subject:
Reply with quote

I guess you did not bother to notice, that your input file display
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
UDAY1111111  p-k 02YN    ¬0714     ±AAA3AAA3                           
ECCEFFFFFFF409691FFED00125FFFF000008CCCFCCCF0444000004444444440000044444
4418111111101702F02852001F071400000F111311130000000000000000000000000000

represents all 'unprintable characters' as space - very helpful.

whereas REXX TRACE option at least differentiates between spaces and 'unprintable':
Code:

 *-*  PARSE VAR   RESULT.I VAR1 +4 VAR2 +30 VAR3 +2 VAR4
 >>>    "UDAY"                                         
 >>>    "1111111 ?p-k?02YN????¬0714????"               
 >>>    "?:"                                           
 >>>    "AAA3AAA3?   ?????         ?????               
       00000100"   


The PARSE instruction works as documented
The data is there, you just need to convert the binary values (or HEX).
H2C might be a good place to start - reading in the documentation.
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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


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