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
 
Manipulation of the input file....

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

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Wed Mar 05, 2014 4:49 pm    Post subject: Manipulation of the input file....
Reply with quote

Hi,

My input file is something like this.

Code:

ABCD   XY.TEST.JCL             
ACF    XYZ.TEST.JCL           
ABYT   T54VSES.TEST.LIB       




My output file should be as below
Code:


ABCD   XY.TEST.JCL                   XY                         
ACF    XYZ.TEST.JCL                  XYZ                       
ABYT   T54VSES.TEST.LIB              T54VSES                   


There is a library name starts at 20th position in the input file, so i need only the high level qualifier of that library at end of each record in my output file.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Wed Mar 05, 2014 5:10 pm    Post subject:
Reply with quote

Try this

Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCD   XY.TEST.JCL
ACF    XYZ.TEST.JCL
ABYT   T54VSES.TEST.LIB
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
    PARSE=(%01=(ABSPOS=1,ENDAT=C' ',FIXLEN=7),
           %02=(ABSPOS=8,FIXLEN=8,ENDBEFR=C'.')),
    BUILD=(1:1,50,51:%02))
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Mar 05, 2014 5:12 pm    Post subject: Reply to: Manipulation of the input file....
Reply with quote

Have a look at PARSE with the option to start from a particular colmn (20), end before your ".", and then use OVERLAY to locate the PARSEd field in the desired position.
Back to top
View user's profile Send private message
sasikumar1984

Active User


Joined: 02 Jul 2007
Posts: 109
Location: Chennai - India

PostPosted: Thu Mar 06, 2014 10:09 am    Post subject:
Reply with quote

Thanks Pandora and Bill...

i changed the code as below and it is working fine for me....

Code:

OPTION COPY                                                   
OUTREC PARSE=(%01=(ABSPOS=10,ENDBEFR=C'.',FIXLEN=8)),         
BUILD=(1:1,50,51:%01)                                         
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Mar 06, 2014 2:48 pm    Post subject: Reply to: Manipulation of the input file....
Reply with quote

Code:
  BUILD=(1:1,50,51:%01)


Whenever BUILD executes it makes a new copy of the current data record, which contains only the fields specified on the BUILD.

Whenever OVERLAY within the length of the existing record executes, it only amends data at the column positions specified in the OVERLAY, all other data remains the same one the same current record.

OVERLAY is a better "fit" to describe what you are doing. OVERLAY will generally require fewer resources.

Where OVERLAY extends an existing record, a new copy of the current data record is created, exactly as with BUILD, but there is no danger of "losing" any of the original input, as you don't have to type the fields, DFSORT is doing it.

When selecting fields from a record, use BUILD. When changing some data in the same position(s)/length(s) on a record or adding a field(s) as an extension to a fixed-length record, use OVERLAY. If OVERLAY wasn't useful, it wouldn't be there.

These are my Rules of Opposable Digits. So as I don't make a ROD for my own back, I can change them if I feel like it.
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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