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

Manipulation of the input file....


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Wed Mar 05, 2014 5:10 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Wed Mar 05, 2014 5:12 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Thu Mar 06, 2014 2:48 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Uploading from desktop, a CSV file, s... DB2 2
No new posts Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
No new posts How to read unpacked field created in... DFSORT/ICETOOL 12
No new posts JCL (SET) variables in input stream data JCL & VSAM 0
Search our Forums:

Back to Top