MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Omit columns from file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed May 07, 2008 1:04 pm    Post subject: Omit columns from file Reply with quote

Hi,

I want to omit some of the columns from input file while copying.

Example..

Input file(80/vb)
Code:

----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
Name     Date           Designation
----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
Siva     07052008       Programmer
Aizaz    06052008       Manager
Sreeram  08052008       Lead


Output file(80/vb)
Code:

----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
Name     Designation
----+----+----+----+----+----+----+----+----+----+----+----+----+----+----
Siva     Programmer
Aizaz    Manager
Sreeram  Lead


Now i don't want date column in the output file and designation column should from date column i.e 10 position.

Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed May 07, 2008 1:16 pm    Post subject: Reply with quote

Assuming the Name field is 9 bytes long and the Designation field starts at position 25 (29 if you count the RDW) in the input file, you can use a DFSORT job like this to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB/80)
//SORTOUT DD LRECL=80,DSN=...  output file (VB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(1,9,14:29)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed May 07, 2008 1:45 pm    Post subject: Reply with quote

Frank,

If you can tell what is RDW it would be a great help

Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed May 07, 2008 2:58 pm    Post subject: Reply with quote

RDW = record descriptor word. For a RECFM=V (VB, etc) file, the RDW occupies the first 4 bytes of the record. The first two bytes contains the length of the record including the RDW itself in binary. The next two bytes contain binary zeros. The first data byte starts in the fifth byte of the record after the RDW.

If you're going to be working with data sets on z/OS, you might want to familiarize yourself with the information in "z/OS Using Data Sets" at:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2D460/CCONTENTS?SHELF=EZ2ZO10J&DN=SC26-7410-07&DT=20070711232714

Here's the description of an RDW in that book:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2D460/3.1.3.1.2?SHELF=EZ2ZO10J&DT=20070711232714&CASE=
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group