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
 

 

DFSORT Help in Formatting

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

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Mon Jun 30, 2008 3:38 pm    Post subject: DFSORT Help in Formatting
Reply with quote

Here is my input
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
PATRICIA ANN JONES       SWB12008-02-18     00.00AR AR               
JUDY GRIMMETT            SWB12008-02-19     00.00AR AR               
CHARLES EANES            SWB12008-02-18     41   AU TX               
ASHLEY CUNNIGHAM         SWB12008-02-18     38.75DA TX               
SCHLAINE FISHER          SWB12008-02-18     38.75DA TX       


LRECL =350
RECFM=FB

At position 45 if its 00.00 then its ahs to prefix by 0000000.00
If any other number like 41 then 0000041.00
so my output should be

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
PATRICIA ANN JONES       SWB12008-02-18     0000000.00AR AR               
JUDY GRIMMETT            SWB12008-02-19     0000000.00AR AR               
CHARLES EANES            SWB12008-02-18     0000041.00AU TX               
ASHLEY CUNNIGHAM         SWB12008-02-18     0000038.75DA TX               
SCHLAINE FISHER          SWB12008-02-18     0000038.75DA TX   
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Jun 30, 2008 5:06 pm    Post subject:
Reply with quote

Hi,

here is an example using LRECL=80
Code:
//S1       EXEC PGM=ICEMAN                                             
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
PATRICIA ANN JONES       SWB12008-02-18     00.00AR AR                 
JUDY GRIMMETT            SWB12008-02-19     00.00AR AR                 
CHARLES EANES            SWB12008-02-18     41   AU TX                 
ASHLEY CUNNIGHAM         SWB12008-02-18     38.75DA TX                 
SCHLAINE FISHER          SWB12008-02-18     38.75DA TX                 
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD    *                                                     
  OPTION COPY                                                           
  INREC IFTHEN=(WHEN=(47,3,CH,EQ,C'   '),OVERLAY=(47:C'.00'))           
  OUTREC OVERLAY=(55:50,5,45:45,5,UFF,ADD,+00000000,                   
        EDIT=(TTTTTTT.TT))                                             
/*                                                                     


Gerry
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

PostPosted: Mon Jun 30, 2008 7:23 pm    Post subject: Reply to: DFSORT Help in Formatting
Reply with quote

There is a small change in my input

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
PATRICIA ANN JONES       SWB12008-02-18          AR AR               
JUDY GRIMMETT            SWB12008-02-19          AR AR               
CHARLES EANES            SWB12008-02-18     41   AU TX               
ASHLEY CUNNIGHAM         SWB12008-02-18     38.75DA TX               
SCHLAINE FISHER          SWB12008-02-18     38.75DA TX   



And my output should be
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
PATRICIA ANN JONES       SWB12008-02-18     0000000.00AR AR               
JUDY GRIMMETT            SWB12008-02-19     0000000.00AR AR               
CHARLES EANES            SWB12008-02-18     0000041.00AU TX               
ASHLEY CUNNIGHAM         SWB12008-02-18     0000038.75DA TX               
SCHLAINE FISHER          SWB12008-02-18     0000038.75DA TX   
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Jun 30, 2008 11:43 pm    Post subject:
Reply with quote

shrivatsa,

The following DFSORT JCl will give you the desired results. The Lrecl is increased by 4 bytes.

Code:

//STEP0100 EXEC PGM=ICEMAN                                     
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
PATRICIA ANN JONES       SWB12008-02-18          AR AR         
JUDY GRIMMETT            SWB12008-02-19          AR AR         
CHARLES EANES            SWB12008-02-18     41   AU TX         
ASHLEY CUNNIGHAM         SWB12008-02-18     38.75DA TX         
SCHLAINE FISHER          SWB12008-02-18     38.75DA TX         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=(45,05,SS,EQ,C'.'),                       
        PARSE=(%00=(ABSPOS=45,ENDBEFR=C'.',FIXLEN=7),           
               %01=(FIXLEN=2)),                                 
         BUILD=(1,44,%00,UFF,M11,LENGTH=7,C'.',                 
                %01,TRAN=ALTSEQ,55:50,300)),                   
        IFTHEN=(WHEN=NONE,                                     
         BUILD=(1,44,45,5,UFF,EDIT=(TTTTTTT),C'.00',55:50,300))
        ALTSEQ CODE=(40F0)                                     
/*                                                             


The output from the above job is

Code:

PATRICIA ANN JONES       SWB12008-02-18     0000000.00AR AR
JUDY GRIMMETT            SWB12008-02-19     0000000.00AR AR
CHARLES EANES            SWB12008-02-18     0000041.00AU TX
ASHLEY CUNNIGHAM         SWB12008-02-18     0000038.75DA TX
SCHLAINE FISHER          SWB12008-02-18     0000038.75DA TX


Hope this helps...

Cheers
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 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
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


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