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

SORT input file, only last 2 characters need in output file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Mon May 02, 2011 5:20 pm
Reply with quote

I have 1 record in input file. I need only last 2 characters to place into the output file.
For exp:

Input file:

0102 rama 12/13/2011 xxxxxxx india

LRECL = 80, RECFormat = Fixed

MY output file should be like below.
ia

Can someone give some idea on it.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 02, 2011 5:26 pm
Reply with quote

well.... all depends
is the record/data content fixed or variable ?
in other words will the wanted chars occupy always the same position or not ?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon May 02, 2011 5:33 pm
Reply with quote

If records are fixed size then you could use, assuming FB and LRECL 80.
Code:
  INREC BUILD=(8,2,3:78X)


Hope it helps.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon May 02, 2011 5:50 pm
Reply with quote

For variable length records, assuming FB LRECL 80, you could use
Code:
  INREC FIELDS=(1,80,JFY=(SHIFT=RIGHT))
  OUTREC FIELDS=(79,2,78X)       


Hope it helps.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top