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

Creating file from an input file


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


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

PostPosted: Fri Apr 16, 2010 12:49 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top