× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Martin,

nice to see someone else working on DPD-Routing.
To convert the Barcode-Id into EBCDIC, I wrote a simple RPG function:

Prototyp for QDCXLATE
D QDCXLATE        PR                  ExtPgm('QDCXLATE')             
D  P$LenInp                      5P 0 const                          
D  P$Text                    32767A   Options(*VarSize)              
D  P$ConvTab                    10A   Const                          
  /QPROLESRC,QDCXLATE

 Procedure
P CvtASCII2AToEBCDIC...                                                         
             
P                 B                   Export                                    
              
 D CvtASCII2AToEBCDIC...                                                        
              
D                 PI             1A                Opdesc                  
Konvertierter Wert 
D   P$Alpha                      2A                Const                   
ASCII numerisch   
                                                                                
              
D DSConvert       DS                                                            
              
D   ASCIIHex                     1A                                        
ASCII alpha        
D   ASCIINum                     3U 0  Overlay(ASCIIHex)                   
ASCII numerisch    
 
*--------------------------------------------------------------------------------------------
 /FREE    
   Monitor;                                                                     
               
     ASCIINum = %Int(P$Alpha);                                            
//Numer.ASCII-Wert   
     QDCXLATE(1: ASCIIHex: 'QEBCDIC');   
     Return ASCIIHex;
   On-Error;
     Return *Blanks;
   EndMon;
 /END-FREE
P                 E

Mit freunlichen Grüßen / Best regards 

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown)
"If you think education is expensive, try ignorance." (Derek Bok) 


----- Original Message ----- 
From: <M.Effenberg@xxxxxxxxxxxx>
To: <rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, October 19, 2006 11:24
Subject: How to print decimal ascii characters?


Hello there,
I have an interesting problem here and i have no idea how to accomplish 
this.

I am printing parcel labels to EPL thermal printers.
These labels have a barcode with an id char at the beginning.

I got a file from our parcel service with routing information and the 
ascii decimal value (!) for that id character.

So the file looks like this:
#Fields: 
DestinationCountry|BeginPostCode|EndPostCode|ServiceCodes|RoutingPlaces|SendingDate|O-Sort|D-Depot|GroupingPriority|D-Sort|BarcodeID|
ES|46101|46109|S299,S302303|GEFDX,GEBED,GENLD,GEALC,GEITD,GEFCO|*|*|0746|9|*|37|

I imported this to my as400 via cpyfrmimpf.
The line above says, that parcels to areas in spain with the zipcodes 
46101 to 46109 should be routed to destination depot 0746 
and the barcode on that label should have the char ascii 37 at the 
beginning (thats '%').

Now i have that '37' in my file on the as400 in an 2a field (drbarc).
And i want to build my barcode like this: 

eval barcode=drbarc+%trim(barcode)

This obviously doesn't work since i just put an '37' in front of my 
barcode.


And my problem is now: how to find out, that decimal ascii 37 is '%', so 
that i can print this in front of my barcode.


Something like:

asciichar=alfa2ascii('37')
// asciichar is now '%'
barcode=asciichar+%trim(barcode)


any hints are greatly appreciated :)


- Martin
-- 
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.