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
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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