View previous topic :: View next topic
|
Author |
Message |
hiteshkataria Currently Banned New User
Joined: 01 Mar 2007 Posts: 1 Location: Chennai
|
|
|
|
I have an input file with some records whose fields are as follows
Code: |
Empno Empname Salary Designation
x(5) x(10) x(6) x(10)
|
I want to get 3 output files, such that the output is
O/p file 1 : contains only empno
O/p file 2 : contains only empname
O/p file 3 : contains only salary and designation |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
hiteshkataria, since you're new, a few tips:
1. Not everyone speaks COBOL. It's better if you show us the actual data, and indicate to us what position a field starts in, what format it's in, and how many characters long it is.
2. You need to specify what the input dataset RECFM and LRECL is, and what you require for the output.
3. Do any of these fields need to be sorted into a specific order? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
hiteshkataria,
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/31)
//OUT1 DD DSN=... empno file (FB/5)
//OUT2 DD DSN=... empname file (FB/10)
//OUT3 DD DSN=... salary/designation file (FB/16)
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,BUILD=(1,5)
OUTFIL FNAMES=OUT2,BUILD=(6,10)
OUTFIL FNAMES=OUT3,BUILD=(16,16)
/*
|
|
|
Back to top |
|
|
|