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
 

 

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: 1529
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: 7225

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: 7225

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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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