Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Using sort card how to replace/change binary value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ssgauli
Warnings : 1

New User


Joined: 06 Jan 2008
Posts: 3
Location: hyd'bad

PostPosted: Wed Aug 13, 2008 12:24 pm    Post subject: Using sort card how to replace/change binary value
Reply with quote

Using sort card how to replace binary value of '200807' to '200606' for the length of 4 bytes binary.

Requirement :

1) I have a file of record length 737.
2) With a field of length 4 bytes binary from starting position 1 to length of 4 bytes binary.
3) Need to change value from '200807' to '200606' (Note : i need to change only first 4 bytes that to from binary to binary of 4 bytes )
4) remaining field from position 5 to 737 need to written as it is from input file.

For example :
From >>>>>>> i need to change LD-MEAS-PRD-ID from '200807'

Code:
LD-MEAS-PRD-ID LD-ARR-ID-CHAIN LD-BUS-UNIT-COR
4/BI                    6/PS                     6/AN           
(1-4)                   (5-10)                   (11-16)       
1-------------        2--------------         3--------------
********************************* TOP OF DATA
        200807        400000004               ABC           



TO >>>>>>>> LD-MEAS-PRD-ID to '200606'

Code:
LD-MEAS-PRD-ID LD-ARR-ID-CHAIN LD-BUS-UNIT-COR
4/BI                    6/PS                     6/AN           
(1-4)                   (5-10)                   (11-16)       
1-------------        2--------------         3--------------
********************************* TOP OF DATA
        200606        400000004               ABC           


Note : I could not find any solution in the search that's the reason i am posting my query into the forum.


I hope you got my query.
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2287
Location: @my desk

PostPosted: Wed Aug 13, 2008 2:27 pm    Post subject:
Reply with quote

Shrinivas,

The below SORT job will do what you asked for.


Code:
//STEP01   EXEC PGM=SORT                                       
//*                                                             
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=your.input.file,DISP=SHR                 
//SORTOUT  DD DSN=your.output.file,DISP=SHR               
//*                                                             
//SYSIN    DD *                                                 
  INREC IFTHEN=(WHEN=(1,4,BI,EQ,200807),OVERLAY=(1:X'00030F9E'))
  SORT FIELDS=COPY                                             
//*


Thanks,
Arun
Back to top
View user's profile Send private message
ssgauli
Warnings : 1

New User


Joined: 06 Jan 2008
Posts: 3
Location: hyd'bad

PostPosted: Wed Aug 13, 2008 3:18 pm    Post subject: Reply to: Using sort card how to replace/change binary value
Reply with quote

Arun , Thanks very much for the help.
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 Aug 13, 2008 10:28 pm    Post subject:
Reply with quote

Or you could use this INREC statement which uses a decimal constant instead of a hex constant for better readability:

Code:

  INREC IFTHEN=(WHEN=(1,4,BI,EQ,200807),
      OVERLAY=(1:+200606,TO=BI,LENGTH=4))
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Change NULL indicator in UNLOAD utility Khadhar Basha DB2 2 Fri Dec 15, 2017 3:01 pm
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us