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

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

New User


Joined: 03 Feb 2006
Posts: 2
Location: Chennai,India

PostPosted: Fri Feb 03, 2006 7:10 pm    Post subject: DFSORT
Reply with quote

Hi

I want to perform the following op/n.

A file contains an amount and a date stored in packed format (E.g. shown below)
20001005
30c1120c
which corresponds to an amount of 23,000 and a date of 11-10-2005

i) First sort the input file based on the date and then convert the data into readable format in the output file.
ii) The amount field should have ?,? and the date should have ?-? as separators.
iii) The two fields should be separated by 5 spaces.

Regards,
Ceasar
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 03, 2006 9:44 pm    Post subject:
Reply with quote

The DFSORT job below will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
* Convert P'mmddyyyy' to Z'mmddyyyy' in 81-88
   INREC OVERLAY=(81:4,5,PD,EDIT=(TTTTTTTT))
* Sort on Z'yyyy' in 85-88 and Z'mmdd' in 81-84
   SORT FIELDS=(85,4,ZD,A,81,4,ZD,A)
* Convert P'nnnnn' to nn,nnn.
   OUTREC FIELDS=(1,3,PD,EDIT=(II,IIT),5X,
* Convert P'mmddyyyy' to C'mm-dd-yyyy'
                  4,5,PD,EDIT=(TT-TT-TTTT))
/*
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 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
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm


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