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

Replace a binary value in a file based on IF condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Sep 15, 2010 8:10 pm
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

Moderator Emeritus


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

PostPosted: Wed Sep 15, 2010 8:27 pm
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 Developer


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

PostPosted: Wed Sep 15, 2010 10:55 pm
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:

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top