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
 

 

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

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

New User


Joined: 27 Feb 2008
Posts: 78
Location: india

PostPosted: Mon May 02, 2011 5:20 pm    Post subject: SORT input file, only last 2 characters need in output file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Mon May 02, 2011 5:26 pm    Post subject: Reply to: SORT input file, only last 2 characters need in ou
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: 1491
Location: Chennai

PostPosted: Mon May 02, 2011 5:33 pm    Post subject:
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: 1491
Location: Chennai

PostPosted: Mon May 02, 2011 5:50 pm    Post subject:
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    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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


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