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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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