Focal Point
[Case-Opened] Read byte by byte in WF

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7347074706

July 27, 2011, 12:16 AM
Vinay Kumar
[Case-Opened] Read byte by byte in WF
Hi,

There is a field called "Name", type of this field is alphanumeric and it should contain the values between 'a' to 'z' and 'A' to 'Z'. If suppose accidentally some one has inserted other than these values then this value should be printed in the output file.

how could this be done in webfocus?

This message has been edited. Last edited by: Vinay Kumar,


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
July 27, 2011, 12:27 AM
Waz
This may help.

http://forums.informationbuild...621050203#8621050203

You will have to hold the column NAME, then use this technique.

If you need to keep track of some sort of key, then that will be more complicated.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

July 27, 2011, 02:12 AM
<JG>
CHKFMT function

Suppose your name is 25 characters

CHK_ID/I3 = CHKFMT(25, name, 'AAAAAAAAAAAAAAAAAAAAAAAAA', CHK_ID);

CHK_ID value of 0 means true 1 means false
July 27, 2011, 07:49 AM
Vinay Kumar
JG,

if its a numeric field then

CHK_ID/I3 = CHKFMT(5, name, '99999', CHK_ID);

i just gave a try please let me know the correct one Smiler

what if we have to check for alphabets and spaces?


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
July 27, 2011, 08:27 AM
<JG>
If you want to check for a space you need to convert them to a value of a - z or A -Z first.

 
DEFINE FILE CAR
CHK_ID/I3 = CHKFMT(16, CTRAN(16, CAR, 32, 65, 'A16'), 'AAAAAAAAAAAAAAAA', 'I3');
END
TABLE FILE CAR
PRINT CAR
      CHK_ID 
BY COUNTRY
BY CAR
BY MODEL
END 

July 27, 2011, 12:37 PM
Dan Satchell
You might find this Forum post helpful: extracting numbers from alphanumeric field


WebFOCUS 7.7.05
July 27, 2011, 12:54 PM
<JG>
Dan, It's not about extracting, it's about validating.
July 27, 2011, 05:53 PM
Waz
quote:
other than these values then this value should be printed in the output file


Its also about extracting.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!