Excellent example Bernie... Thanks!
> -------- Original Message --------
> Subject: [RBASE-L] - Re: Fixed Position File Export
> From: "Bernard Lis" <[EMAIL PROTECTED]>
> Date: Tue, February 28, 2006 10:05 pm
> To: [email protected] (RBASE-L Mailing List)
>
> Hi Rob.
> Here is a snippet of code that I use to create electronic W2 info to send to
> Fed.
>
> set var ln = 'RW'
> *( eliminate the dash in ssn, if exists )
> Label again2
> set var ipos = (sloc(.ssn,'-'))
> if ipos > 0 then
> set var lngth = (slen(.ssn))
> set var nchar = (.lngth - .ipos)
> set var ssn = (smove(.ssn,(.ipos+1),.nchar,.ssn,.ipos))
> set var ssn = (sput(.ssn,' ',.lngth))
> goto again2
> endif
> set var ln = (sput(.ln,.ssn,3))
> set var ln = (sput(.ln,.fnm,12))
> set var ln = (sput(.ln,.lnm,42))
> set var ln = (sput(.ln,.addr,66))
> set var ln = (sput(.ln,.addr,88))
> set var ln = (sput(.ln,.ecity,110))
> set var ln = (sput(.ln,.estate,132))
> set var ln = (sput(.ln,.ezip,134))
> -- set var ln = (sput(.ln,.ezip4,139))
> set var ln = (smove(.ezip4,2,5,.ln,139))
> set var igrs int = (.grs * 1000/10 + .005)
> *( right justify & zero fill into an 11 digit text field )
> set var ln = (sput(.ln,(format(.igrs,'[-]00000000000')),188))
> set var ifed int = (.fitwh * 1000/10 + .005)
> set var ln = (sput(.ln,(format(.ifed,'[-]00000000000')),199))
> set var ficawag = .grs
> if grs > .maxfica then
> set var ficawag = .maxfica
> endif
> set var ifica int = (.ficawag * 1000/10 + .005)
> set var ln = (sput(.ln,(format(.ifica,'[-]00000000000')),210))
> set var isst int = (.sstwh * 1000/10 + .005)
> set var ln = (sput(.ln,(format(.isst,'[-]00000000000')),221))
> set var ln = (sput(.ln,(format(.igrs,'[-]00000000000')),232)) *( M/R
> Wages)
> set var imr int = (.mrtwh * 1000/10 + .005)
> set var ln = (sput(.ln,(format(.imr,'[-]00000000000')),243))
> set var ln0 = (sfil('0',110))
> set var ln = (sput(.ln,.ln0,254))
> set var ln = (smove(.ln0,1,22,.ln,364))
> set var ln = (smove(.ln0,1,11,.ln,386))
> set var ln = (smove(.ln0,1,22,.ln,408))
> set var ln = (smove(.ln0,1,11,.ln,430))
> set var ln = (smove(.ln0,1,1,.ln,486))
> set var ln = (smove(.ln0,1,2,.ln,488))
> set var ln = (sput(.ln,'0',512))
> out w2report append
> write .ln
> out screen
>
> Hope this helps,
> Bernie Lis
>
> ----- Original Message -----
> From: "Rob Vincent" <[EMAIL PROTECTED]>
> To: "RBASE-L Mailing List" <[email protected]>
> Sent: Monday, February 27, 2006 10:48 PM
> Subject: [RBASE-L] - Fixed Position File Export
>
>
> >
> > Is there a way to export data from Rbase in a fixed field position
> > format?
> >
> > I remember in the 'ole days, RBDOS 4.5Plus had a Fixed format export in
> > Gateway
> > where you would place [S]tart and [E]nd markers for the specified
> > fields.
> >
> > Never thought I would need this functionality again, BUT a customer
> > needs to supply
> > accounting information to a customer on a regular basis in this format.
> >
> > Looks like they are planning on importing this into some COBOL program
> > based on the
> > sample format they provided.
> >
> > Any recommendations on how I might be able to accomplish this would be
> > appreciated.
> > Thanks -- Rob
> >
> > --- RBASE-L
> > ================================================
> > TO POST A MESSAGE TO ALL MEMBERS:
> > Send a plain text email to [email protected]
> >
> > (Don't use any of these words as your Subject:
> > INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
> > REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
> > ================================================
> > TO SEE MESSAGE POSTING GUIDELINES:
> > Send a plain text email to [email protected]
> > In the message SUBJECT, put just one word: INTRO
> > ================================================
> > TO UNSUBSCRIBE:
> > Send a plain text email to [email protected]
> > In the message SUBJECT, put just one word: UNSUBSCRIBE
> > ================================================
> > TO SEARCH ARCHIVES:
> > Send a plain text email to [email protected]
> > In the message SUBJECT, put just one word: SEARCH-n
> > (where n is the number of days). In the message body,
> > place any
> > text to search for.
> > ================================================
> >
> >