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: 8120
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
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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