Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Help with sort card to update a part of record.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Help with sort card to update a part of record.
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 17, 2010 9:24 pm    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Sep 17, 2010 9:29 pm    Post subject:
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    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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us