arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
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. |
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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'))
/*
|
|
|