Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : Q. If there is a situation, where we need to code more than 255 steps in a JOB? A. We need to split jcl into two jcls , at the end of the first jcl check the condition code and initiate the second jcl.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


Help required for a sort step of a VB file

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
ambilileela
Member


Joined: 06 Jun 2006
Posts: 11

PostPosted: Thu Sep 28, 2006 1:33 pm    Post subject: Help required for a sort step of a VB file Reply with quote

Hi,

I want to sort a VB formatted file and remove the duplicates after summing up the amount. For e.g.. I have a file having 4 fields in it. Lets say Emp#, Empname, Account, Salary. The records are like:

36,sar,rte,456
45,amb,,698
36,sar,rte,400
45,amb,rte,600

I want to sort the above file so that my O/P looks like :

36,sar,rte,856
45,amb,,698
45,amb,rte,600

So, basically I want to get a sum of the amount fileds of the records that has the same value for all other fields.
It is easy for FB file but since my VB file does not have the same length for all the records, I am not able to do it Sad . Please help.

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

Krishna
Site Admin


Joined: 27 Jan 2006
Posts: 937

PostPosted: Thu Sep 28, 2006 3:50 pm    Post subject: Variable length files Reply with quote

Hi ambilileela,


My suggestion is to use cobol program to create FB file and then use SORT to get result.

we can sort VB file by giving starting position as actual starting pos + 4 in sort card.


Following Link may be useful to you

Smart DFSORT Tricks
http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

Thanks,
Krishna
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 511
Location: San Jose, CA

PostPosted: Thu Sep 28, 2006 9:12 pm    Post subject: Reply with quote

Actually, this is a comma separated value (CSV) file. It has fields with variable positions. It might also be a VB file but I'm guessing it's really an FB file.

You can use the following DFSORT job to do what you asked for. However, you'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE and SQZ functions. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

If the input file is actually VB, let me know and I'll show you how to change the job to handle that.


Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
36,sar,rte,456
45,amb,,698
36,sar,rte,400
45,amb,rte,600
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  INREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=5),
               %02=(ENDBEFR=C',',FIXLEN=5),
               %03=(ENDBEFR=C',',FIXLEN=5),
               %04=(FIXLEN=5)),
        BUILD=(1:%01,C',',
               7:%02,C',',
              13:%03,C',',
              19:%04,UFF,TO=ZD,LENGTH=5)
  SORT FIELDS=(1,5,CH,A,7,5,CH,A,13,5,CH,A)
  SUM FIELDS=(19,5,ZD)
  OUTREC OVERLAY=(19:19,5,ZD,TO=FS,LENGTH=5,
        1:1,23,SQZ=(SHIFT=LEFT))
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Krishna
Site Admin


Joined: 27 Jan 2006
Posts: 937

PostPosted: Fri Sep 29, 2006 10:38 am    Post subject: Reply with quote

Thanks Frank.


Thanks,
Krishna
Back to top
View user's profile Send private message Send e-mail
ambilileela
Member


Joined: 06 Jun 2006
Posts: 11

PostPosted: Fri Sep 29, 2006 11:56 am    Post subject: Reply with quote

It is a VB file only. So, please let me know the code for a VB file.

Thanks,
Ambili
Back to top
View user's profile Send private message
Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 511
Location: San Jose, CA

PostPosted: Fri Sep 29, 2006 8:40 pm    Post subject: Reply with quote

This version of the DFSORT job will work for a VB file. Remember that you need the April, 2006 DFSORT PTF. The job won't work without it.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...    input file (VB)
//SORTOUT DD DSN=...   output file (VB)
//SYSIN    DD    *
  INREC PARSE=(%01=(ABSPOS=5,ENDBEFR=C',',FIXLEN=5),
               %02=(ENDBEFR=C',',FIXLEN=5),
               %03=(ENDBEFR=C',',FIXLEN=5),
               %04=(FIXLEN=5)),
        BUILD=(1,4,
               5:%01,C',',
              11:%02,C',',
              17:%03,C',',
              23:%04,UFF,TO=ZD,LENGTH=5)
  SORT FIELDS=(5,5,CH,A,11,5,CH,A,17,5,CH,A)
  SUM FIELDS=(23,5,ZD)
  OUTREC OVERLAY=(23:23,5,ZD,TO=FS,LENGTH=5,
        5:5,23,SQZ=(SHIFT=LEFT))
  OUTFIL VLTRIM=C' '
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts IAM BEGINNER IN JCL ...PLZ HELP ME 3 Guest 13745 Wed Jul 07, 2010 8:20 am
anilsani285 View latest post
No new posts Hi plz help me out 5 Guest 5554 Wed Jul 07, 2010 8:18 am
anilsani285 View latest post
No new posts File-Aid Help 1 Nicholas 8862 Thu Apr 13, 2006 2:12 pm
rangab View latest post
No new posts Search Batch file-aid help 6 frenchman 9768 Tue Mar 28, 2006 5:30 pm
Guest View latest post
No new posts executing java program thru JCL 1 Guest 8017 Fri Mar 17, 2006 10:14 am
arrbee View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB