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 sum up amounts in characters from a VBA file

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

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Sep 30, 2011 10:21 pm    Post subject: Sort card to sum up amounts in characters from a VBA file
Reply with quote

Hi,

I have a VBA input file for with below properties.

SORTIN : RECFM=VBA ; LRECL= 240; BLKSIZE= 3124

The record contents are like below.

Code:


=COLS> ----+----1----+----2----+----3----+----4----+----5
000005                                                   
000006  ID       SOURCE LINES                           
000007      ----+----1----+----2----+----3----+----4----+
000008                                                   
000009                                                   
000010                                                   
000011                                                   
000012  I - +0000000000268.26 20110630 135205 MG00C02   
000013  D - +0000000000268.26 20110731 135205 MG00C02   
000014  I - -0000000000266.82 20110630 135205 MG00C02   
000015  D - -0000000000266.82 20110731 135205 MG00C02   


I want to sum up the above amounts(starting from 6 all characters) group by the first character 'I' or 'D' and the date starting from 2 and 24 positions respectively. But I am facing difficulty in defining the positions in the sort card.

my outfile would be RECFM=FB,LRECL=80,DSORG=PS.

Could someone please suggest a sort card for this?
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Sep 30, 2011 10:46 pm    Post subject: Reply to: Sort card to sum up amounts in characters from a V
Reply with quote

ksouren007,

Use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=&&T1,DISP=SHR                                       
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  INCLUDE COND=(6,1,SS,EQ,C'I,D')                                     
  SORT FIELDS=(6,1,CH,A,28,8,CH,A),EQUALS                                   
  OUTFIL REMOVECC,NODETAIL,VTOF,BUILD=(80X),                         
  SECTIONS=(1,1,28,8,                                                 
  TRAILER3=(6,4,                                                     
            TOT=(10,17,SFF,EDIT=(STTTTTTTTTTTTTTT.TT),SIGNS=(+,-)),   
            27,25))                                                   
//*


The output from this job is
Code:

D - +000000000000001.44 20110731 135205 MG00C02
I - +000000000000001.44 20110630 135205 MG00C02
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Sep 30, 2011 11:01 pm    Post subject:
Reply with quote

It worked great!! Thanks a lot Skolusu..you guys rock!
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 VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm

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