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
 
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 0 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm

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