Jump to content


Photo
- - - - -

Not able to DSEL records


7 replies to this topic

#1 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 08 January 2006 - 09:16 AM

i am not able to deselect records. Here is the case

Default logic : sel-only field1a

file1 : read this file ( field1a,field1b,,,,,,,)

file2 : read file2 with field1a (map to field2a), After read : if file2b(1,3) # 'abc' the DSEL exit

file3 : write records in file3 with fields of file1 and file2


file1 key is of length 5 bytes ie 3 (field1a) + 10(field1b).
file2 key is of length 5 bytes ie 3 (field2a) + 5(field2b).



file3 is having 'abc' records and also records whose feild2b is blank.

Can someone guide me here ? :unsure:
Thanks & Regards,
Basy

#2 Chris Pepper

Chris Pepper

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 369 posts
  • Gender:Male
  • Location:United Kingdom

Posted 08 January 2006 - 10:14 AM

The processing structure in ProIV is that if you have a one-to-many relationship you need to create a new LU.
LU1 SEL-ONLY (defines a set of records to be processed from File 1)
The list of files defines the processing for each record selected from the first file (file 01)
File 01 - read next record in the set
File 02 - nn process a single record with a fully defined set of keys. You must be able to fully specify the key on all 02-nn reads.

If you want to process a relationship with one-to many (e.g. order header to order lines) then you put in another LU.

So...
LU1 (start LU1 end LU2) SEL-ONLY(field1a)
01 file1

LU2 (start LU2 end LU2) field2a = field1A SEL-ONLY(field2a)
01 file2 (after read Dsel)
02 file3 add

Is this what you intend? I'm not quite sure what the relationship between your two files is. The two files share the same first part of the key, but have a different second part, so I'm not sure.

#3 Mike Nicholson

Mike Nicholson

    Expert

  • Members
  • PipPipPipPip
  • 196 posts
  • Gender:Male
  • Location:Stockholm, Sweden

Posted 08 January 2006 - 10:12 PM

Let me just confirm what I think you're doing.

File 1 : SEL-ONLY On first part of key
File 2 : Direct read with all key values set from field values of file 1. DSEL on ARNE.
File 3 : Add record

The DSEL on file 2 is not catching everything you think? Is this right?

If this is the case I would suggest the problem is when you have a record in file 1 that has no corresponding record in file 2. That would account for the blank fields being added to file 3. In that case just put a DSEL in the ARE logic too.

If, on the other hand, file 2 is not a direct read based on values obtained from file 1 then see the previous post.

Cheers

Mike

#4 Chris Mackenzie

Chris Mackenzie

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 368 posts
  • Gender:Male
  • Location:Bristol, United Kingdom

Posted 09 January 2006 - 11:02 AM

Checking the obvious first: is this in a paging screen or an update/report?

Because DSEL doesn't function in a paging screen - you need to
use a sort/select on files 1 & 2.
The content and views expressed in this message are those
of the poster and do not represent those of any organisation.

#5 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 09 January 2006 - 11:36 AM

Thanks Chris , Mackenzie and Mike, it is a simple mistake. Now i have put dsel in ARE for file2 and not getting blank records

I am new to pro iv , recently shifted from mainframe background.
WIll improve. :unsure:
Thanks & Regards,
Basy

#6 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 09 January 2006 - 01:48 PM

one more query for the same problem.

now ARE is working. Before this i tried with dsel logic in file3 (before write for those blank records)

even i am able to validate the field and display the field as blank.

logic in before write for file3:

populate data for file3 .......
if file2b(1,3) = ' ' then umsg("file2b" + fiel2b,-1) dsel exit
else
file3b= file2b(1,3)
endif.

file3 is seq. file , into which records are written. I didn't understand , what's wrong with the code, as it is working ie displaying the blank fields , but not able to stop records from writting .... :unsure:
Thanks & Regards,
Basy

#7 Rick Young

Rick Young

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 265 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 09 January 2006 - 02:09 PM

Use DSELF in B4WRT instead of DSEL. By the time you get to B4WRT, it's "too late" to DSEL.


-RIck

#8 basy

basy

    Member

  • Members
  • PipPip
  • 17 posts
  • Gender:Male
  • Location:denver
  • Interests:sports, current affairs

Posted 10 January 2006 - 07:36 AM

Rick, thanks for sharing the info.


i was member of couple of mainframe forums,where i used to help others often and gained knowledge from some senior guys .


when i came to know that , i am about to work on pro iv for some business reasons , the first thing i was looking for is FORUM.

This forum is doing great. Thanks to all members for sharing their ideas and knowledge . :unsure:
Thanks & Regards,
Basy



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users