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
 
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

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