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

Modifying record with X'FFFFFFFF'


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Sat May 05, 2012 12:34 am
Reply with quote

Hi,

I am trying to work on a scenario where i need to update the last record in the file.

Input file if of 32500 Reclength.

File Data looks like this.

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
            12123                                                       
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
-----------------------------------------------------------------------
PAYM  O¶    ¾     `T715014         ð                1715014     S1894628
DCED00DB0001B002007EFFFFFF01014400080000000044444444FFFFFFF00101EFFFFFFF
71840166000F9C2202937150140A0A0000AC0000000000000000171501400A0A21894628
-----------------------------------------------------------------------
      â  qo"  q ¤                                                       
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000


In this I want to update the last record . Value to be replaced are

Code:

--+--
*****
-  -
  q ¤
00939
0088F


Starting position will be 13 and I I need to update it like.

Code:

--+--
*****
-  -
  q ¤
00001
0000F


I am not able to do it. Can please suggest some idea on this.

Thanks
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: Sat May 05, 2012 1:00 am
Reply with quote

Hello,

Will the last record always have x'FFFFFFFF' in the first 4 bytes?

Will the last record be the only record that can have x'FFFFFFFF' in the first 4 bytes?

Will the replacement value always be the same?

Is there some reason this packed-decimal field contains the F-sign rather than the more typical C-sign?
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Sat May 05, 2012 1:08 am
Reply with quote

Hi Dick,

Thanks for the quick response


Quote:

Will the last record always have x'FFFFFFFF' in the first 4 bytes?

Yes

Quote:

Will the replacement value always be the same?


Yes

Quote:

Is there some reason this packed-decimal field contains the F-sign rather than the more typical C-sign?

Not sure but it will be like this only.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat May 05, 2012 1:29 am
Reply with quote

scorp_rahul23,

Assuming that ONLY the last record has X'FFFFFFFF' in the first 4 bytes the following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD DSN=your input 32500 FB file,DISP=SHR
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                               
  SORT FIELDS=COPY                             
  INREC IFTHEN=(WHEN=(1,4,CH,EQ,X'FFFFFFFF'), 
  OVERLAY=(13:+1,TO=PDF,LENGTH=5))             
//*     
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: Sat May 05, 2012 1:29 am
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,4,BI,EQ,X'FFFFFFFF'),
    OVERLAY=(13:X'000000001F'))
/*
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Sat May 05, 2012 2:13 am
Reply with quote

Thanks a lot Frank and Skolusu.

Both approach worked .... icon_smile.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top