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 -> Comma delimited and Zero supressed file

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

New User


Joined: 23 Oct 2007
Posts: 5
Location: Hyderabad

PostPosted: Thu Jun 19, 2008 9:59 am    Post subject: SORT -> Comma delimited and Zero supressed file
Reply with quote

Hi all,

I have a Req like this. Can this be done with SORT.

Input data

Code:

Field - A     Field - B
  1,000         250   ->> Both are 7 bytes. COBOl dec is (PIC ZZZ,ZZ9)
  2,000         500


Requirement (o/p data ):-
Add two more fields(Total and Percentage) at the end of the file.

Code:

Field - A     Field - B
  1,000         250
  2,000         500
===========
  3,000         750   --> Total is needed here
                25%   --> Percentage is needed in this line
                          ((Field - B/Field - A)*100)


Note:-
1. Field - A and Field - B is Zero supressed and COMMA delimited File.

We are doing this requirement in COBOL pgm.But i am curious to know whether we can do this in SORT icon_biggrin.gif icon_biggrin.gif ( which is always my favorite).

Thanks & Regards,
Anish K
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Thu Jun 19, 2008 10:38 pm    Post subject: Reply to: SORT -> Comma delimited and Zero supressed file
Reply with quote

anishkannath,

The following DFSORT/ICETOOL JCl will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN       DD *                                               
----+----1----+----2----+----3----+----4----+----5----+----6---
  1,000,    250                                               
  2,000,    500                                               
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)     
//T2       DD DSN=&&T2,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)     
//P        DD SYSOUT=*                                         
//TOOLIN   DD *                                               
  COPY FROM(IN) USING(CTL1)                                   
  COPY FROM(T1) USING(CTL2)                                   
//CTL1CNTL DD *                                               
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,                         
  BUILD=(80X),                                                 
  TRAILER1=(TOT=(1,7,UFF,EDIT=(TTTTTTTT)),X,                   
            TOT=(9,7,UFF,EDIT=(TTTTTTTT)))                     
/*                                                             
//CTL2CNTL DD *                                               
  INREC OVERLAY=(30:(+100,MUL,10,8,ZD),DIV,1,8,ZD,M10,LENGTH=3)
  OUTFIL FNAMES=T2,                                           
  BUILD=(C'T1,C''',1,8,C'''',/,                               
         C'T2,C''',10,8,C''''/,                               
         C'P1,C''',30,3,C'%''',80:X)                           
/* 
//STEP0200 EXEC PGM=ICEMAN               
//SYSOUT   DD SYSOUT=*                   
//SYMNOUT  DD SYSOUT=*                   
//SORTIN   DD *                         
----+----1----+----2----+----3----+----4-
  1,000,    250                         
  2,000,    500                         
//SYMNAMES DD DSN=&&T2,DISP=SHR         
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                         
  SORT FIELDS=COPY                       
  OUTFIL REMOVECC,                       
  TRAILER1=(01:C'=======',X,'=======',/,
            01:T1,10:T2,/,10:P1)         
/*
Back to top
View user's profile Send private message
anishkannath

New User


Joined: 23 Oct 2007
Posts: 5
Location: Hyderabad

PostPosted: Fri Jun 20, 2008 9:15 am    Post subject:
Reply with quote

Hi..

Thanks a lot for the reply. Code is working perfect.

One more question.

If i need to ZERO suppress and add COMMA delimiters for the the Final Total what should be the Edit in the trailer?

Thanks & Regards,
Anish Kannath
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