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
 

 

Creating file from an input file

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

New User


Joined: 23 Mar 2007
Posts: 35
Location: pune

PostPosted: Fri Apr 16, 2010 12:09 am    Post subject: Creating file from an input file
Reply with quote

Hi
I have a requirement
1. Input file is 80 bytes long
2. There are 3 primary fields
Colm 1 thru 3 makes Field 1
Colm 4 thru 8 makes Field 2
Colm 50 makes Field 3
3. I need the output file to have
i. all the three fields together with duplicates eliminated
ii. An extra row with field 1 , space in field 2 and the value 'A' in field 3
iii. after combining records of i & ii , the records should be sorted on the entire length

Is it possible to do it in a single step ?

Input file

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--------8
11112054                                         A                         
11112054                                         A                         
11112321                                         A                         
11112431                                         A                         
22210033                                         A                         
22210033                                         A                         
22211021                                         A                         
33312011                                         B                         
33312012                                         B                         
33312012                                         B                         
33312013                                         B                         
33312024                                         B                         
55514562                                         A                         
55515621                                         A         


Output file
Code:
----+----1
**********
111     A
11112054A
11112321A
11112431A
222     A
22210033A
22211021A
333     A
33312011B
33312012B
33312013B
33312024B
555     A
55514562A
55515621A   
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Apr 16, 2010 12:49 am    Post subject:
Reply with quote

Here's a DFSORT job that produces the output you show from the input you show.

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/9)
//SYSIN DD *
  INREC BUILD=(1,8,50,1)
  SORT FIELDS=(1,9,CH,A)
  SUM FIELDS=NONE
  OUTFIL REMOVECC,
    SECTIONS=(1,3,
      HEADER3=(1,3,9:C'A'))
/*
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 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


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