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
 

 

Formatting using DFSORT SPLICE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
raveendra_ibm
Currently Banned

New User


Joined: 07 Jan 2006
Posts: 31

PostPosted: Fri Feb 16, 2007 2:05 pm    Post subject: Formatting using DFSORT SPLICE
Reply with quote

Hi All,

Here is a requirement that i am working on :

We have two input files : Credit and Debit.

For output we have the following scenarios :

a) Entry present in CR file only => copy as it is into OUT file
b) Entry present in DR file only => change the sign of amount field and write into the OUT file
c) Entry present in both files => subtract amount fields i.e CR - DR and write into OUT file
The amount values displayed are actually in PACKED Decimal format. S9(11)V99 comp-3.

Trailer record contains the count (including header and trailer)

Code:
File-CR Layout

   HDR   XXXX
   DET   A222   100.00
   DET   A333   600.00
   DET   A555   300.00
   DET   A666   400.00
   TRL   0006

Code:
File-DR Layout

   HDR   XXXX
   DET   A111   200.00
   DET   A222   400.00
   DET   A444   700.00
   DET   A555   900.00
   DET   A999   300.00
   TRL   0007


Code:
Desired Output Layout :

   HDR   XXXX
   DET   A111   -200.00      
   DET   A222   -300.00   
   DET   A333    600.00
   DET   A444   -700.00
   DET   A555   -600.00   
   DET   A666    400.00
   DET   A999   -300.00
   TRL   0009


Could you please help me out on this.

Thanks,
Raveendra.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Feb 16, 2007 3:49 pm    Post subject:
Reply with quote

All fixed... icon_biggrin.gif
Raveendra,
If you have looked at other posts on this forum, you may have noticed that most posts have included additional information like lrecl, recfm and such. Take a look and add the info, your help will be available sooner.
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: Fri Feb 16, 2007 11:48 pm    Post subject:
Reply with quote

Ravenendra,

You don't need SPLICE for this.

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed that your input files have RECFM=FB and LRECL=80, that the first field is in positions 1-3, the second field in positions 9-12 and the third field (7-byte PD) in positions 15-21.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SORT FROM(T1) USING(CTL3)
/*
//CTL1CNTL DD *
  OMIT COND=(1,3,SS,EQ,C'HDR,TRL')
/*
//CTL2CNTL DD *
  OMIT COND=(1,3,SS,EQ,C'HDR,TRL')
  INREC OVERLAY=(15:15,7,PD,MUL,-1,TO=PD,LENGTH=7)
/*
//CTL3CNTL DD *
  SORT FIELDS=(9,4,CH,A)
  SUM FIELDS=(15,7,PD)
  OUTFIL FNAMES=OUT,REMOVECC,
    HEADER1=(C'HDR',9:C'XXXX'),
    TRAILER1=(C'TRL',9:COUNT+2=(EDIT=(TTTT)))
/*
Back to top
View user's profile Send private message
raveendra_ibm
Currently Banned

New User


Joined: 07 Jan 2006
Posts: 31

PostPosted: Sat Feb 17, 2007 11:30 am    Post subject: Re: Formatting using DFSORT SPLICE
Reply with quote

Thanks a lot Frank.. Its working !!!!

William,
Quote:
Take a look and add the info, your help will be available sooner
Taken a note of the same. Would provide all the necessary details in my subsequent posts. Thank you.

Regards,
Raveendra
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 DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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