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

Sort card to insert a new field in the file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Jan 30, 2008 5:44 pm
Reply with quote

The data in the file before the field is inserted is like

File is a VB and length is 139 before inserting the field.

H.2008-01-01.07:28:07. 541
J.A00.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.85%
J.A01.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.90%
J.A02.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.95%
J.A03.V .00..00..00.2099-06-30.Ulster Bank Base Rate+1%

Now I need to insert a new field at the 3rd position of the file
and the data looks like this after inserting the field

Here we have inserted the '986550.'

H.2008-01-01.07:28:07. 541
J.986550.A00.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.85%
J.986550.A01.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.90%
J.986550.A02.V .00..00..00.2099-06-30.Ulster Bank Base Rate+.95%
J.986550.A03.V .00..00..00.2099-06-30.Ulster Bank Base Rate+1%
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: Wed Jan 30, 2008 10:30 pm
Reply with quote

Here's a DFSORT job that will do what you asked for. Note the use of IFTHEN to avoid changing the H record.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(5,1,CH,NE,C'H'),
    BUILD=(1,6,C'986550.',7))
/*
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Thu Jan 31, 2008 5:42 pm
Reply with quote

Thanks Frank

It works for me.

Can you let me know how to handle the same using the OUTREC
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: Thu Jan 31, 2008 10:08 pm
Reply with quote

Quote:
Can you let me know how to handle the same using the OUTREC


INREC and OUTREC are interchangeable in this situation, so there's no reason to use OUTREC rather than INREC. But if you want to use OUTREC, you can just change INREC to OUTREC:

Code:

  OUTREC IFTHEN=(WHEN=(5,1,CH,NE,C'H'),
    BUILD=(1,6,C'986550.',7))
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top