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: 10291
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: 1510
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: 1510
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 IO Error in SORT santoshks1987 SYNCSORT 0 Fri Aug 18, 2017 12:15 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 3 Fri Aug 18, 2017 10:50 am
No new posts Getting Mutiple input from Panels vidyaa CLIST & REXX 11 Mon Aug 14, 2017 1:28 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am


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