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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

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