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

Best Method/Utility to modify HEX value within a dataset?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MrExtraordinare

New User


Joined: 11 Feb 2010
Posts: 4
Location: USA

PostPosted: Mon Mar 09, 2015 10:09 pm
Reply with quote

What is the best method or utility within a JCL that would allows me to submit the job that will modify the HEX value from X'00' to X'40' without regard to a particular position or byte?

I'm trying to do a simple "Change" type commands to modify the hex value to change from X'00' to X'40' value.

Here is my JCL:
Code:
//STEP01   EXEC PGM=IKJEFT01                             
//*                                                       
//SYSTSPRT DD SYSOUT=*                                   
//SYSTSIN  DD *                                           
EDIT 'HLQ1.HLQ2.TEST.DATA' TEXT NONUM
TOP                                                       
C X'00' X'40'
END SAVE                                                 
/*                                                       


In 3.4 in ISPF, after doing a HEX ON command, this is what the data looks like:

Code:

----+----1----+----2----+----3----+----4
ZZZ BSS 
EEE4CEE00FF00000000000000000F00000000000
999022200FFFF0F0FFFFFFFFFFF0FF0000000000



Here is my sysout telling me that 'TEXT NOT FOUND'
Code:
READY                                                     
EDIT 'HLQ1.HLQ2.TEST.DATA' TEXT NONUM
EDIT                                                     
TOP                                                       
C X'00' X'40'                                     
TEXT NOT FOUND                                           
END SAVE                                                 
READY                                                     
END                                                       


I'm open to ideas. I do not understand why the above is telling me that 'TEXT NOT FOUND' when I know I can execute the same command within ISPF in edit mode inside my dataset without issue.

Am I doing something wrong here or missed something?

If you have a better idea/suggestion as to use DFSORT or something else, I'm open to it.

I appreciate any assistance you can provide as I'm beyond frustration.
Back to top
View user's profile Send private message
rinsio

New User


Joined: 16 Feb 2015
Posts: 13
Location: Madrid, Spain

PostPosted: Mon Mar 09, 2015 10:35 pm
Reply with quote

Hello MrExtraordinare
In my opiniĆ³n you can use ALTSEQ command of DFSORT is very useful. But you need to indicate from/to yoy want the make the change.
Below an example:


//SORT02 EXEC PGM=SORT,COND=(0,NE)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=
//SORTOUT DD DSN=
// DCB=(LRECL=1300,RECFM=FB,BLKSIZE=0,DSORG=PS),
// UNIT=SYSDA,DISP=(,CATLG,DELETE),
// SPACE=(TRK,(15,10),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
ALTSEQ CODE=(0040) * SUST.
OUTREC FIELDS=(1,415,416,17,TRAN=ALTSEQ,433,868)


In this case, from 416, 17 position the DFSORT change the values x'00' found.

Regards
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 09, 2015 10:43 pm
Reply with quote

Because in ISPF you are not using the TSO editor. In your batch job you are.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 09, 2015 10:45 pm
Reply with quote

Rinsio,

It would seem that the example shown by TS/OP just intends to change the first X'00' to X'40'.
Back to top
View user's profile Send private message
MrExtraordinare

New User


Joined: 11 Feb 2010
Posts: 4
Location: USA

PostPosted: Mon Mar 09, 2015 10:59 pm
Reply with quote

My intention is to eventually do a CHANGE ALL to replace all instances of X'00' with X'40'.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Mar 09, 2015 11:06 pm
Reply with quote

Well then, if you are looking for an alternative to using the TSO line-editor, in batch, then Rinsio's ALTSEQ is a very good suggestion :-)
Back to top
View user's profile Send private message
MrExtraordinare

New User


Joined: 11 Feb 2010
Posts: 4
Location: USA

PostPosted: Tue Mar 10, 2015 12:02 am
Reply with quote

Rinsio & Bill,

I appreciate your ALTSEQ suggestion which did work perfect. It replaced all instances of X'00' to X'40'.

I found this example which fit what I was looking for:
http://ibmmainframes.com/about31293.html

This is what I used:
Code:
//SYSIN    DD *                   
  SORT FIELDS=COPY                 
  ALTSEQ CODE=(0040)               
  INREC BUILD=(1,102,TRAN=ALTSEQ)
/*                                 




where:
(0040) where 00 is the value you want to replace with the new 40 value.
OUTREC's 1 is first position and 102 is the LRECL.

Hope this help others who may have same issue.

Thank you very much! I appreciate your help.

--MrE

De-OUTREC FIELDS'd
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts REASON 00D70014 in load utility DB2 6
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top