• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Selecting LIKE records from F4101

Boris G

Well Known Member
Dear list,

I'm trying to select multiple records from the F4101 file based on a BASE Item. For example, if the Base Item is 'EC2C', the F4101 could have 'EC2C1', 'EC2C2', etc.

I thought that the following code would do it but it doesn't work, returning File_IO_Status = 'CO ERROR'

F4101.Select
VA sec_Base_Item_LITM is Like TK 2nd Item Number
F4101.Fetch Next
VA sec_Short_Item_ITM <- TK Item Number - Short
VA sec_Identifier2ndItem_LITM <- TK 2nd Item Number
While SV File_IO_Status is equal to CO SUCCESS
....

How do I get a set of Items based on a subset?

Thanks,
Boris
JDE OneWorld B7332 SP10
 
Hi Boris,

if you go into the jdedebug.log I will probably see that the LIKE command
does not work, it creates a normal sec_Base_Item_LITM is = TK 2nd Item
Number. I solved the problem in the following way. I padded a % on both
sides of the variable. In your case ì2C% and then I use the variable in my
select statement. I was working on B7331, sp(cannot remember) OS WinNT, SQL
server.

Hope this will help you, Greetings.

Lars Jorgensen
XE sp15, AS400
 

neil_shepherd

Well Known Member
Hi Boris,

I've never had much luck adding %'s though I see Lars has got this to work, maybe I should have another go. The (not very nice) way I've got round this in the past is to set data selection >= 'EC2C' and <= 'EC2CZZZZZ' or whatever would meet the needs.

Regards

Neil.

OW B733.2, SP 11.1
Sun Solaris/UNIX
 
Top