IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Split a RECORD into different variables


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Apr 27, 2009 1:57 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top