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 write specific fields from VB file to VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Thu Dec 13, 2007 5:52 pm    Post subject: How to write specific fields from VB file to VB file
Reply with quote

I have one requirement. I want to extract only specific fields based on some criteria from VB file to another VB file.

Thanks and Regards
Lakshmi
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: Thu Dec 13, 2007 10:48 pm    Post subject:
Reply with quote

Quote:
I want to extract only specific fields based on some criteria from VB file to another VB file.


You need to supply more information. What is the criteria exactly? What fields do you want to extract?

Show an example of the records in your input file (relevant fields only) and the records you expect for output. Give the starting position, length and format of each relevant field. Use the example to explain what you want to do. Remember that VB records have an RDW in positions 1-4, so the first data byte starts in position 5.
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Dec 14, 2007 4:04 pm    Post subject:
Reply with quote

Hi

I have Employee details file as input which is having fields like

Field name Length Type Starting Positions
Empno 7 Numeric 1
Ename 20 Character 10
Salary 7 Float(9(5)v99) 32
Designation 20 Character 41

I want to extract the records which are having salary greter than 15000 or Designation as Software Engineer to Variable block file.

Regards
Lakshmi
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Dec 14, 2007 4:10 pm    Post subject: Reply to: How to write specific fields from VB file to VB fi
Reply with quote

Varalakshmi,

Code a SORT card using an INCLUDE condition after taking into account the RDW.
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Fri Dec 14, 2007 5:00 pm    Post subject: Reply to: How to write specific fields from VB file to VB fi
Reply with quote

Hi

I have coded SORT card like

Code:

  SORT FIELDS=(45,20,CH,A)
  INCLUDE COND=((36,7,PD,GE,15000),OR,
                         (45,20,CH,EQ,C'SOFTWARE ENGINEER'))


BUT IT IS WRITING ALL RECORDS TO OUTPUT FILE.

Please tell me what is the wrong in it.

Regards,
Lakshmi
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Dec 14, 2007 9:49 pm    Post subject:
Reply with quote

Hello,

It appears that your record layout does not match your INCLUDE CONDs.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Dec 14, 2007 10:05 pm    Post subject: Re: Reply to: How to write specific fields from VB file to V
Reply with quote

varalakshmi.G wrote:

Field name Length Type Starting Positions
Empno 7 Numeric 1
Ename 20 Character 10
Salary 7 Float(9(5)v99) 32
Designation 20 Character 41

Code:

  SORT FIELDS=(45,20,CH,A)
  INCLUDE COND=((36,7,PD,GE,15000),OR,
                         (45,20,CH,EQ,C'SOFTWARE ENGINEER'))


BUT IT IS WRITING ALL RECORDS TO OUTPUT FILE.

Please tell me what is the wrong in it.

Regards,
Lakshmi



Is SALARY packed decimal or float or zoned decimal? Your sort card has packed decimal, but you layout is unclear. If it is float then the 9(5)v99 is meaningless, if it is 7 bytes long and the 9(5)v99 is correct then it is not packed or float. Is 15000 suppose to represent 150.00 or 15000.00? If you are looking for a salary greater than 15000.00 then you need to use 1500000.
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 Dec 14, 2007 11:15 pm    Post subject:
Reply with quote

Lakshmi,

I suspect

Salary 7 Float(9(5)v99)

is a 7-byte ZD field representing ddddd.dd - if you want to compare this to 15000.00, then you can use:

36,5,ZD,GE,15000

or

36,7,ZD,GE,1500000
Back to top
View user's profile Send private message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Tue Dec 18, 2007 5:12 pm    Post subject: Reply to: How to write specific fields from VB file to VB fi
Reply with quote

Hi

Thanks a lot for your help.

Regards
Lakshmi
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 -> JCL & VSAM 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 write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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