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
 

 

How to separate dataset with some fields only

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

New User


Joined: 01 Mar 2007
Posts: 1
Location: Chennai

PostPosted: Fri Mar 02, 2007 9:10 pm    Post subject: How to separate dataset with some fields only
Reply with quote

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
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Mar 02, 2007 9:27 pm    Post subject: Re: How to separate dataset with some fields only
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Fri Mar 02, 2007 9:55 pm    Post subject:
Reply with quote

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
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


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