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

Working with hex values in Filemanager batch job

IBM Mainframe Forums -> IBM Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Emile Straker

New User

Joined: 27 Mar 2013
Posts: 3
Location: United Kingdom

PostPosted: Tue Sep 12, 2017 1:42 am
Reply with quote


I'm trying to do a simple find & replace of a field using the following:


££FILEM DSU INPUT=DD01,       
££FILEM     PROC=*             
IF FLD(269,9) ¬= '         ' &,
   FLD(269,9) ¬= '000000000'
THEN DO               

As well as spaces and zeros, the field above can contain x'000000000000000000'

I also want to ignore the field if it is all hex zeros.

The manual advised there are additional operators for Binary, Packed Decimal & Zoned Decimal, but I can't get the result I'm after.

Any help would be greatly appreciated.
Back to top
View user's profile Send private message

New User

Joined: 25 Jan 2018
Posts: 60
Location: Australia

PostPosted: Mon Jan 29, 2018 2:59 am
Reply with quote

2 ways to code that – In both cases hex string is specified with standard REXX ‘hhhh’x notation.

Option 1 - Using contains operator and one function call – note ‘,,’ is required for parameter delimiter and REXX continuation

IF FLDI(269,9,'CO','000000000000000000'X,,
' ') THEN

Option 2 – Using FLD() function similar to what they’ve attempted.
IF FLD(269,9) ¬= '000000000000000000'X,
& FLD(269,9) ¬= '0000000000',
& FLD(269,9) ¬= ' ' THEN

Under FASTREXX which both will run there would be probably no difference in performance.

Response c/- of FM Developer @ HCLTECH
Cheers Hank, HCLTECH
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 -> IBM Tools


Similar Topics
Topic Forum Replies
No new posts Call an hlasm from REXX in batch and ... CLIST & REXX 4
No new posts SPOOL to Mainframe dataset in batch mode JCL & VSAM 7
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
Search our Forums:

Back to Top