Layout:
Home > Boy Does My Head Hurt...

Boy Does My Head Hurt...

January 11th, 2007 at 09:49 pm

I've been coding too long this week!

I think I'm done, actually, which is GOOD NEWS. Why? Cause this is what I'm starting to see when I close my eyes to go to bed at night... GAH!!!


--------------------------
CREATE VIEW dbo.UHG_Compiled AS
--------------------------
select
convert (varchar(5), b.VersionIndicator) AS VersionIndicator,
convert (varchar(8), b.GroupID) AS GroupID,
convert (varchar(12), '') AS B01,
convert (varchar(2), a.Relationship_Code) AS Relationship,
'00' AS F01,
convert (varchar(9), b.SSN) AS SSN,
convert (varchar(4), '') AS B02,
CASE a.Relationship_Code
When '18' THEN '00'
ELSE ' '
END F02,
CASE a.Relationship_Code
When '18' THEN convert (varchar(9), b.SSN)
ELSE ' '
END ESSN,
convert (varchar(4), '') AS B03,
'00' AS F03,
convert (varchar(13), '') AS OSSN,
convert (varchar(16), '') AS B04,
convert (varchar(8), b.HireDate) AS HireDate,
convert (varchar(12), '') AS B05,
replace((replace((replace((replace((replace(convert(varchar(20), a.LastName), '/', ' ')),'-','')),'#','Nbr ')),',','')),'.','') AS LastName,
--------------------------
DTS UHG_Export
--------------------------
HEADER.txt
DECLARE
@count int,
@use varchar(5)
set @count = (select count(*)+1 FROM UHG_Compiled)
set @use = convert(varchar(5), @count)
SELECT
' ' AS Filler,
replicate ('0', 8 - LEN(@use))+@use AS InclHeader,
'|' AS EOF
BODY.txt
VIEW dbo.UHG_Compiled
--------------------------
UHG.bat
--------------------------
# Create UHG Export File, compile header.txt and body.txt,
# add date-stamp to .gsf file
#
@echo off
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
set dow=%%i
set month=%%j
set day=%%k
set year=%%l
)
set date=%year%%month%%day%
set file=SUBMITID.U.%date%0000.gsf
copy c:UHGUHG_header.txt+c:UHGUHG_body.txt c:UHG%file%
exit

12 Responses to “Boy Does My Head Hurt...”

  1. janH Says:
    1168552737

    Huh?? I just have dreams of flying helicopters.....or being chased by alligators....

  2. pjmama Says:
    1168553307

    We wont even get into MY dreams... talking racoons and such.

  3. chimbleysweep Says:
    1168553776

    That might as well be gibberish to my eyes!! Glad you're finished!!

  4. boomeyers Says:
    1168553986

    Wow! Glad you know what that means!
    I usually don't remember any of my dreams. I am too tired to remember!

  5. Broken Arrow Says:
    1168561642

    What kind of language is that? Javascript? Also... why are you coding in the first place? Homework assignment or work related? The variables suggests a personal calculation for your own use perhaps?

    Whatever it is, that's impressive! You're the first woman I know that can actually code (not to imply that women can't code or anything).

    I've done QuickBasic, REALBasic, Python, C, Cplusplus (the plus symbol doesn't seem to want to show), Objective C and a tiny bit of C# and Pascal. I don't do any coding right now (and honestly, don't remember much anyways), but maybe someday, when I have a lot more time on my hands, I'd probably like to do it again just for fun... like the way I used to do it in my childhood days. Smile

  6. Broken Arrow Says:
    1168561869

    Oh, and let me just say that what you've just listed would be considered by many in geek circles as "HAWT HAWT HAWT!"

    Married or not, I doubt you'll have trouble finding (geeky) men slobbering after you. Big Grin

    edit: I just looked at your script again. Is that a DOS batch file?! Probably not, but if it is, your geek creds just shot up from "WOW!" to "INSANE WOW!".

  7. tinapbeana Says:
    1168563003

    that, my dear, is SQL and it's for work. specifically, we design the benefits system for one of our clients, including coordinating the data dump with their provider. they decided at the beginning of december to change providers (right before open enrollment, of course!), which means a complete overhaul of the datafile we send out. no more Excel, it's gotta be a flat-text data point delimited, PGP encrypted yadda yadda yadda. new datafile with existing data means new tables, views, and data transformations. bluh...

    actually, i don't mind it. i'm good at determining the logic flow, but the syntax always get me when i get started.

    went from turbo pascal (HA!) to C + +, to HTML, to Perl, PHP, java. currently at work it's mainly SQL, XML, JavaScript, some C#. since we do a lot with Lotus Notes and Domino, there's also Lotus Script/Formula, which is based on JavaScript/Visual Basic (respectively).

    no real training, just good at reverse engineering. it reminds me of a MasterCard commercial, actually!
    Oracle DBA book: 79.99
    Lotus Domino Admistrator book: 59.95
    JavaScript in a Nutshell (800 pgs no less): 55.00
    Ability to fake it well enough to get the job done? PRICELESS!!!

    i don't know many geeks anymore, actually. other than those i work with. in the past, i've dated my fair share of geeks. remember those 2 federally recognized hackers? ex's, and one designed the original BoA automated phone system....

    and to the feds, i again say "I hack for good, not evil!"... i can only imagine what's in my file, guilt by association you know Big Grin

  8. Broken Arrow Says:
    1168564030

    Good lord, that is really fascinating! Amazing that it still bears many syntax resemblances to back in the haydays of DOS.

    Wow, that's scarey. A good looking woman who likes weaponry and has coding chops. With such a fearsome and fascinating combination, the mind truly boggles as to why any man would cheat on you!

  9. tinapbeana Says:
    1168564552

    well, yes, UHG.bat actually is a DOS batch file. it's the only way i can find to concatenate 2 files into a separate 3rd file without going into an activeX DTS. since i really ain't gotta clue about activeX i decided to avoid it! had to have 2 files b/c the first row in the final doc doesn't match datapoints with all the other rows, so i couldn't run them into the same file with the same query. plus, the batch file makes it easy to add the date stamp to the file, which is one of the many formatting requirements. both of these are much easier to do in unix, so i was really frustrated to spend 2 days working out how to do in in Win.

    boy, i just realized that sounds like a bunch of gobbilty gook! sorry to wax geeky, all!

    as for the possible cheating, i'm stickin' with "mo-ron!".

  10. Broken Arrow Says:
    1168565022

    Ah, so it is DOS! Okay, now I feel like I've recovered some of my geek creds. Big Grin Were it a personal project, I would have said something along the lines of *cough* Apache and MySQL *cough*, but you obviously would have known that. That and since it is for your job, I realize your hands would be tied to whatever they throw at you to use.

    And yes, it's a bunch of gobbly gook, but I don't mind it (don't know about anyone else though Big Grin). In fact, I'm tempted to ask why in the world would anyone want to delve into ActiveX? But again, I don't do SQL scripting, and I haven't even touched Windows since... 1998 I think (not counting surfing the internet at work Big Grin).

    Conceptually though, it does seem like a rather clever workaround. So long as it works!

  11. tinapbeana Says:
    1168565871

    well, here's the long & short of it, not sure how familiar you are w/ SQL. data is in MS SQL Server, relational tables. data is exported to any other format via a DTS (data transformation service) in MS Enterprise manager (or whatever it's called). easiest thing to do (and most common) is a 'column copy' DTS: "just copy everything from column 1 in SQL to column 1 in excel, etc, and BTW column1 in excel needs to be 5 characters long, column 2 is 8 characters long, etc". samething for text files, only the columns are imaginary (kinda!).

    my problem was that columns 1,2, and 3 had to be different character lengths for the first row than for the 868 other rows. a normal 'copy everything' DTS won't do the trick here. and, without using an activeX DTS procedure, i couldn't even get it to append to the same file it kept overwriting. that's no good!

    so, i went around my elbow to scratch my a$$. all in all, still pretty elegant considering...

    i am, however, sticking my head in the sand about trying to create a web interface for this crap. first time i've ever seen a website that runs on a .dll coded in C#. WTF!!!

  12. LuckyRobin Says:
    1168584099

    Uh...Tina? I hope they pay you well.

Leave a Reply

(Note: If you were logged in, we could automatically fill in these fields for you.)
*
Will not be published.
   

* Please spell out the number 4.  [ Why? ]

vB Code: You can use these tags: [b] [i] [u] [url] [email]