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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am


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