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
 
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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

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