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
 

 

Replace a binary value in a file based on IF condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
siddheart22

New User


Joined: 09 Oct 2006
Posts: 19
Location: Toronto

PostPosted: Wed Sep 15, 2010 8:01 pm    Post subject: Replace a binary value in a file based on IF condition
Reply with quote

Hi,

I have a file of 120 bytes, with X'004D' (decimal 77) at position 82 in it on some records.
My requirement is to sort the file on certain fields and for all records where there is X'004D' in position 82, replace it with X'0037' (decimal 55) and rewrite the rest of the data in output.
I am using a SORT utility to do this, with the following sort card:
Code:

 SORT FIELDS=(1,1,CH,D,2,7,PD,A)
 OUTREC IFTHEN=(WHEN=(82,2,PD,EQ,X'004D'),
            BUILD=(1:1,81,82:X'0037',84:84,37))


The job fails on this SORT step, with following error:
ICE751I 2 C5-K48846 DA-K48846
ICE185A 0 AN S913 ABEND WAS ISSUED BY DFSORT, ANOTHER PROGRAM OR AN EXIT (PHASE 0)

I am looking for some assistance in resolving this issue.

Thanks,
Sid.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8054
Location: East Dubuque, Illinois, USA

PostPosted: Wed Sep 15, 2010 8:10 pm    Post subject:
Reply with quote

Contact your site support group -- S913 is security abend meaning you don't have access to one of the files.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 15, 2010 8:27 pm    Post subject:
Reply with quote

Hello,

Also, a binary value is not PD. . . PD is Packed Decimal.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Sep 15, 2010 10:55 pm    Post subject:
Reply with quote

Sid,

Once you fix the 913 security error, you can use the following DFSORT statements to do what you asked for:

Code:

 SORT FIELDS=(1,1,CH,D,2,7,PD,A)
 OUTREC IFTHEN=(WHEN=(82,2,BI,EQ,X'004D'),
            OVERLAY=(82:X'0037'))


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 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


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