IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to write specific fields from VB file to VB file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Dec 13, 2007 10:48 pm
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
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: 1287
Location: Chennai, India

PostPosted: Fri Dec 14, 2007 4:10 pm
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
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

Moderator Emeritus


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

PostPosted: Fri Dec 14, 2007 9:49 pm
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
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 Developer


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

PostPosted: Fri Dec 14, 2007 11:15 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top