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

Help with sort card to update a part of record.


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

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Fri Sep 17, 2010 9:05 pm
Reply with quote

Hi All,
I need to update my input file. But i have to update only first 2 records with different values.

file type: FB
rec len : 300
position of the variable to be updated: 30 with 8 bytes. (x(08))

and first record i need 'XXXXXX03' and second record i need 'XXXXXX13' where X is space and the rest of the records need to copied without any change.
I know we can manuplate any part of record with outrec, but i need ony first 2 recods with different value to be updated. Can anyone please help me with sort card.
thank you in advance.
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: Fri Sep 17, 2010 9:24 pm
Reply with quote

Hello,

Quote:
I need to update my input file.
No, you need to make a copy with the changes and then use the copy (or delete/rename) for the other processing. It is unacceptable most places to destroy the input file. . .

One way to do what you want is to introduce a sequence number for each record and then only make the change to sequence 1 and 2.
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: Fri Sep 17, 2010 9:29 pm
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 (FB/300)
//SORTOUT DD DSN=...  output file (FB/300)
//SYSIN DD *
  OPTION COPY
  INREC IFOUTLEN=300,
   IFTHEN=(WHEN=INIT,OVERLAY=(301:SEQNUM,8,ZD)),
   IFTHEN=(WHEN=(301,8,ZD,EQ,1),OVERLAY=(30:C'      03')),
   IFTHEN=(WHEN=(301,8,ZD,EQ,2),OVERLAY=(30:C'      13'))
/*
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top