IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Feb 03, 2006 9:44 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top