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
 

 

Sort card to insert a new field in the file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort card to insert a new field in the file
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 Moderator


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

PostPosted: Wed Jan 30, 2008 10:30 pm    Post subject:
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    Post subject: Thanks Frank
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 Moderator


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

PostPosted: Thu Jan 31, 2008 10:08 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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