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
 
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 Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us