How to replace a FIXEDBIN number by another number in a file

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Anithavincy
Member
Posts: 2
Joined: Thu May 03, 2012 9:59 am

How to replace a FIXEDBIN number by another number in a file

Post by Anithavincy » Thu May 03, 2012 10:11 am

Hi All,

I need to replace a FIXEDBIN number of length 2 (position is 3-4) by another number in a PS file.Is there any sort condition similar to FINDREP?
In my case I need to replace 00 by 01.Thanks in advance:)

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Thu May 03, 2012 5:52 pm

As you know where you want to replace and with what you want to replace you can use the OVERLAY keyword.
Regards
Nic

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu May 03, 2012 9:58 pm

Anithavincy,

If you want help, you'll need to do a better job of explaining exactly what it is you want to do.

Is FIXEDBIN equivalent to ZD, PD, BI or something else? If you don't know, show a few values in hex.

Please show an example of the records in your input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file.

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? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Anithavincy
Member
Posts: 2
Joined: Thu May 03, 2012 9:59 am

Post by Anithavincy » Fri May 04, 2012 11:12 am

Hi Nic\Frank,

Kindly find the detailed information ,

Input file:
Organization : PS
Record format : FB
Record length : 168

We have various fileds in the input file where we need to replace the generation field from "0" to "1" by using Sort .(By giving the input file and getting the output in another file of same specifications with the replacement of generation)

Structure of Generation:
1 IRITEM, IRI COMMON ITEM RECORD FORMAT
5 O_SYSTEM FIXED BIN(15),
5 O_GENERATION FIXED BIN(15),

For your refernece,
The input file only with the frist two fields(using FILEAID),

O_SYSTEM O_GENERATION
2/BFX 2/BFX
(1-2) (3-4)
1------- 2-----------
**********************
8 0
8 0
8 0
8 0
8 0
8 0
8 0

In the above Generation should be changed as follows,

O_SYSTEM O_GENERATION
2/BFX 2/BFX
(1-2) (3-4)
1------- 2-----------
***********************
8 1
8 1
8 1
8 1
8 1
8 1
8 1

Thanks,
Anitha.

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri May 04, 2012 10:04 pm

FIXED BIN(15) is a 2-byte BI value.

It's still not clear what you want to do exactly, though.

If you want to put X'0001' in positions 3-4 of every record, you can use these DFSORT statements:

Code: Select all

   OPTION COPY
   INREC OVERLAY=(3:X'0001')
If you only want to replace X'0000' in positions 3-4 with X'0001', you can use these DFSORT statements:

Code: Select all

   OPTION COPY
   INREC IFTHEN=(WHEN=(3,2,BI,EQ,X'0000'),OVERLAY=(3:X'0001')
If you want to replace X'0000' anywhere in the record with X'0001', you can use these DFSORT statements:

Code: Select all

   OPTION COPY
   INREC FINDREP=(IN=X'0000',OUT=X'0001'
If you want to do something else, you need to be more specific about what you want to do.

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? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others