AS/400 RPG IV Programmer exam questions :: 000-266 Real Exam Questions | Pass4sure Braindumps | VCE Practice Test

IBM AS/400 RPG IV Programmer












AS/400 RPG IV Programmer exam questions
000-266 Exam Dumps | Real Exam Questions | 000-266 VCE Practice Test


000-266 Exam Dumps Contains Questions From Real 000-266 Exam



Click and download 000-266 exam braindumps and VCE files
We have testimonials of many candidates that pass 000-266 exam with their braindumps. All are working at great position in their separate associations. This isn't on the grounds that, they utilize their 000-266 dumps, they really feel improvement in their knowledge. They can work in real environment in association as expert. They don't simply concentrate on passing 000-266 exam with their braindumps, yet really improve knowledge about 000-266 objectives and topics. In this way, people become successful in their field.

It require you to clear your concepts about all main concepts and objectives to Pass 000-266 000-266 exam. Just reading 000-266 course book is not sufficient. You need to learn about tricky scenarios and questions asked in real 000-266 exam. You need to go to killexams.com and download Free 000-266 PDF sample questions and read. If you feel that you can understand those 000-266 questions, you should register to download complete 000-266 question bank at very attractive discount coupons. That will be your first step toward success in 000-266 exam. Download and install 000-266 VCE exam simulator in your computer. Memorize 000-266 dumps and take practice test frequently with VCE exam simulator. When you feel that you are ready for real 000-266 exam, go to test center and register for actual test.

Passing 000-266 000-266 exam let you to clear your concepts about objectives of 000-266 exam. Simply reading 000-266 course book isn't adequate. You have to find out about tricky questions asked in real 000-266 exam. For this, you have to go to killexams.com and download Free 000-266 PDF dumps test questions and read. If you feel that you can retain those 000-266 questions, you should register to download question bank of 000-266 dumps. That will be your first great advance toward progress. Download and install VCE exam simulator in your PC. Read and memorize 000-266 dumps and take practice test as often as possible with VCE exam simulator. When you feel that you are prepared for real 000-266 exam, go to test center and register for real test.

Features of Killexams 000-266 dumps

-> 000-266 Dumps download Access in just 5 min.
-> Complete 000-266 Questions Bank
-> 000-266 Exam Success Guarantee
-> Guaranteed Real 000-266 exam Questions
-> Latest and Updated 000-266 Questions and Answers
-> Verified 000-266 Answers
-> Download 000-266 Exam Files anywhere
-> Unlimited 000-266 VCE Exam Simulator Access
-> Unlimited 000-266 Exam Download
-> Great Discount Coupons
-> 100% Secure Purchase
-> 100% Confidential.
-> 100% Free Dumps Questions for evaluation
-> No Hidden Cost
-> No Monthly Subscription
-> No Auto Renewal
-> 000-266 Exam Update Intimation by Email
-> Free Technical Support


Kill your 000-266 exam at first try with 000-266 dumps questions
killexams.com 000-266 exam braindumps offers all of you that you need to take IBM certification exam. Their IBM 000-266 Exam will provide you with braindumps of exam questions with confirmed answers that replicate the real exam. They at killexams.com are made plans to empower you to pass your 000-266 exam with excessive ratings.

LOT-985 | A2090-422 | C9060-509 | 000-465 | 000-298 | C4040-332 | 000-288 | C9050-042 | P6040-025 | C2090-423 | A2090-545 | P2040-052 | A2010-654 | LOT-989 | 000-275 | 00M-503 | 000-960 | M2050-243 | A2040-922 | M2010-719 |



Date coping with in RPG IV

After spending time on RPG-linked e mail lists, like RPGIV@yahoogroups.com or rpg400-l@midrange.com, you locate one of the most most generally requested questions are about using dates in RPG IV. this article covers the basics of date dealing with in RPG IV. due to the fact that most of us don't seem to be at the most recent stage of the operating device, yours really covered, the ideas and strategies discussed here will work with V5R1 or later. this article will now not cover the use of dates with embedded SQL, which has particular concerns.

WHEN IS A DATE A DATE?

Dates customarily have been stored as numeric variables. now and again they have been lucky sufficient to have separate fields for 12 months, month, and day values, and perhaps a century container. but regularly they have been saddled with six- or eight-digit numeric fields holding some form of a date. To make matters worse, some artful designers didn’t like either one, so they obtained seven-digit fields–six digits with a century byte.

Then there are all of the character container types of these, with separators, devoid of separators, with main zeros, without main zeros. Compound the situation by way of due to the fact that all of the different date formats and the inability of format enforcement, and also you start to get a really bleak view of the “state of the date.”

So when handling dates, the query is: “Is it a real date, or a numeric or personality field pretending to be a date?” We’ve already mentioned the numeric and character dates, however what is a true date? a true date is a program or a file variable that's definitely described as a date variable. To try this in an RPG IV program, outline a variable in a D-spec, with an interior facts classification of d:

d myDate s d

The default price of a date variable is 0001-01-01, or the first day of the primary month of the first year.

You’ll word there are not any length declarations and no commentary about even if the date is numeric or personality. That’s as a result of a real date is a variable class of its personal. A date, even with structure, is saved via the gadget in a uncooked binary manner that best the operating device can entry and manipulate. In an RPG IV program, that records is accessed through variables, the use of a distinct structure.

DATE formats

To clarify, a date exists independent of its structure. right here is a short listing of some regular formats. (a complete list is obtainable on the IBM’s iSeries information middle and within the ILE RPG Reference.)

  • *YMD – YY/MM/DD
  • *DMY – DD/MM/YY
  • *ISO – YYYY-MM-DD
  • *country – MM/DD/YYYY
  • note that all these date codecs consist of separator characters. Now let’s create their date field once again, however this time with a default price:

    d myDate s d inz(d'2004-05-01')

    There are two issues of word here. First, to set the price of a date field with a literal, it must be preceded through the letter d and wrapped in single citation marks (‘). here is additionally real for comparing date values in conditional statements:

    if myDate = d'2005-05-01' ; // code endif ;

    second, the format I’ve used to initialize the date is *ISO: the default DATFMT (date layout) for date literals is *ISO.

    The above statements will compile, however accept as true with this:

    d myDate s d inz(d'05/01/2004')

    if you are attempting to collect this, you'll get hold of an RNF0305 error, pointing out that “the date literal isn't valid,” since the layout of the date literal is *us of a, however, as mentioned, the default required is *ISO. that you could exchange this habits through including an H-spec for DATFMT:

    h DATFMT(*us of a)

    Now the entire date fields on your program require literals to be within the *united states of america format. something structure you utilize, you ought to be consistent all over your program.

    A DATE IS A DATE IS A DATE

    The essential issue to bear in mind to date is that their two dates are equal, inspite of structure, that means that a press release equivalent to if myDateISO = myDateUSA could be real. be aware that the working device retailers dates in a binary manner, despite layout. This makes feel, since the 1st of may also 2004 is always the 1st of may also 2004: the date itself doesn't exchange since you view it in a undeniable format. That mentioned, you could ask, “what good does a structure do?”

    Assigning a structure to a date field makes outputting the date cost as favored very essential. when you output a date, the layout of the text outputted will correspond with the DATFMT exact. look at various this with here code pattern:

    d myDateISO s d datfmt(*ISO) inz(d'2004-05-01') d myDateUSA s d datfmt(*u . s . a .) inz(d'2004-05-01') d myDateString s 10a /free dsply myDateISO ; dsply myDateUSA ; *inlr = *on ; /conclusion-free

    if you run this little application you should get the following output:

    DSPLY 2004-05-01 DSPLY 05/01/2004

    So the DATFMT is awfully convenient for controlling the output of a variable. actually, you’ll observe I didn’t even hassle to transform the date variables to personality first. here's because, when viable, the compiler will do it for you on the fly.

    Of course, date fields can be assigned values from other date fields, so in case you have a date in *ISO structure and also you wish to screen it in *u . s . a ., readily circulation the cost into a container defined as *united states of america and display that box:

    d myDateISO s d datfmt(*ISO) inz(d'2004-05-01') d myDateUSA s d datfmt(*u . s .) inz(d'2000-03-25') d myDateString s 10a /free myDateUSA = myDateISO ; dsply myDateUSA ; *inlr = *on ; /conclusion-free

    before i'm going on, I’d want to element out the D-spec for the myDateUSA variable. in case you seem to be within the options area, you’ll see that I actually have detailed DATFMT(*usa), and yet nevertheless used an *ISO formatted literal string for the initial value! in the beginning glance this seems wrong, however in case you set the DATFMT of an individual variable, it doesn't have an effect on the rules for literals mentioned above: you're going to always use literals for assigning and comparing within the layout distinctive to your assemble remark. in this case, I haven't detailed a DATFMT for the compiler, so all of the date literal operations require the *ISO layout. in this case, specifying datfmt(*ISO) for the myDateISO variable is an useless redundancy used for illustration.

    MAKING DATES FROM NUMERIC VARIABLES

    To populate a date variable from whatever thing aside from a literal string, you need to use the IBM-offered %date BIF. If used and not using a parameters, %date will return the present gadget date.

    d myDate s d /free myDate = %date(); // myDate = *the existing equipment date* *inlr = *on ; /conclusion-free

    think about you have got a numeric variable containing a host representing a date in a YYYYMMDD format:

    d myDate8 s eight 0 inz(20040501)

    In its numeric edition, here's *ISO format, so they can create their date like so:

    /free myDate = %date( myDate8 ); /conclusion-free

    Now they now have a “real” date container populated with the equivalent of “might also 1, 2004”, but when their numeric price become in a unique layout this wouldn’t work. in this case they deserve to inform the %date BIF what the format of the incoming numeric should correspond to:

    d myDate s d d myDate8 s eight 0 inz(05012004) /free myDate = %date( myDate8 : *usa ); dsply myDate ; *inlr = *on ; /end-free

    in case you compile and run this, you'll see that they nonetheless get their output in the *ISO format. here's because they didn't change the DATFMT of the myDate variable; they best prompt the %date BIF to are expecting the incoming parameter in the *usa format.

    to this point we’ve concentrated on date codecs with four-digit years. whereas ideally they might all use four-digit years all the time, this isn’t very simple, since there are nevertheless lots of six-digit numeric dates floating round available pretending to be “real” dates. not to be troubled, %date can handle these as smartly, considering you deliver the applicable format identify.

    d myDate s d d myDate6 s 6 0 inz(050104) /free myDate = %date( myDate6 : *MDY ); dsply myDate ; *inlr = *on ; /end-free

    Of path, 050104 can simply as easily be interpreted as *YMD or *DMY. compile and run here snippet:

    d myDate s d d myDate6 s 6 0 inz(050104) /free myDate = %date( myDate6 : *MDY ); dsply myDate ; myDate = %date( myDate6 : *DMY ); dsply myDate ; myDate = %date( myDate6 : *YMD ); dsply myDate ; *inlr = *on ; /conclusion-free

    and you get the following effects:

    DSPLY 2004-05-01 DSPLY 2004-01-05 DSPLY 2005-01-04

    Three distinctive dates from the equal variable. The lesson right here, of route, is to be very cautious with six-digit fields. The different thing to consider is that the legitimate date range with any two-digit-yr date structure is proscribed to quite a number years from 1940 to 2039. while this may not appear like a problem, the default for any date box is 0001-01-01, which is out of the range of legitimate two-digit-year dates.

    MAKING DATES FROM persona VARIABLES

    character variables are used in a great deal the identical way, however with some entertaining additions. when you use a personality variable within the %date BIF, you need to be a bit greater specific. by using definition, a numeric variable can't comprise separator characters, but here's not proper for a character variable. As such, you need to teach the %date BIF no matter if to expect separator characters in the supplied variable. by means of default the BIF will are expecting separators. in an effort to specify no separators, add a 0 to the conclusion of the DATFMT name:

    d myDate s d d myDateWithSep s 10a inz('2005-05-01') d myDateNoSep s 10a inz('20050501') /free myDate = %date( myDateWithSep : *ISO ); dsply myDate ; myDate = %date( myDateNoSep : *ISO0 ); dsply myDate ; *inlr = *on ; /end-free

    in case you don’t refer to the relevant format, you're going to receive an error message: “Date, Time or Timestamp value is not legitimate (C G D F).” this is a accepted break out message for any date conversion problems.

    ERROR handling

    Inevitably, you are going to try to use an invalid variable value or a non-corresponding DATFMT parameter when populating a date variable. There are a couple of easy methods to tackle these mistakes for your classes.

    the primary way is to verify the correctness of the variable value before issuing the %date BIF. that you can accomplish this by using the look at various opcode with each the d (date) and e (error) extenders. The d error instructs the verify opcode to test the validity of the date, and the e opcode will set on the %error BIF if an error occurs–during this case, if the string doesn't comprise legitimate date advice.

    d myDate s d d myDateWithSep s 10a inz('2004-04-31') /free verify(de) *ISO myDateWithSep ; if %error(); // handle error else ; myDate = %date( myDateWithSep : *ISO ); endif ; *inlr = *on ; /conclusion-free

    If %error is *ON, then an error occurred. If *OFF, then the facts in the variable is suitable with the DATFMT special.

    The different components is to function the %date BIF operation internal a video display-ENDMON block:

    d myDate s d d myDateWithSep s 10a inz('2004-04-31') d error s 10a inz('ERROR!') /free monitor ; myDate = %date( myDateWithSep : *u . s . a . ); on-error ; // address error dsply error ; endmon ; *inlr = *on ; /end-free

    Now that you've a sound, populated, “true” date container, there are several cool issues you could do.

    DATE MATH

    With true date fields, and a few further offered BIFs, date math couldn’t be any more straightforward. There are BIFs for including and subtracting days, months, or years: accurately, these are %days, %months, and %years. beneath are some examples of a way to use these BIFs with your date variable:

    d myDate s d inz(d'2004-05-01') /free // myDate = '2004-05-01' myDate = myDate + %days(three) ; // myDate = '2004-05-04' myDate = myDate + %months(1) ; // myDate = '2004-06-04' myDate = myDate - %years(2) ; // myDate = '2002-06-04' *inlr = *on ; /end-free

    CALCULATING DATE ameliorations

    Calculating the change between two dates is also very effortless, using a further BIF, %diff. This BIF permits you to evaluate two dates and to calculate the difference in days, months, or years.

    d myDate1 s d inz(d'2004-05-01') d myDate2 s d inz(d'2004-05-08') d diff_days s 2s 0 d diff_months s 2s 0 d diff_years s 4s 0 /free diff_days = %diff( myDate2 : myDate1 : *days ); // diff_days = 7 diff_months = %diff( myDate2 : myDate1 : *months ); // diff_months = 0 diff_years = %diff( myDate2 : myDate1 : *years ); // diff_years = 0 *inlr = *on ; /conclusion-free

    you could get a terrible return cost if the primary parameter is an previous date than the second parameter. To steer clear of this, both make sure that the better date is at all times first or use the %abs (absolute price) BIF on the return price:

    diff_years = %diff( myDate2 : myDate1 : *years ); diff_years = %abs(diff_years); dsply diffyears;

    You might also want to embed this outcomes in a personality string. usually, %char will do that for you nicely:

    /free myString = 'there's a change of ' + %char( %diff( myDate2 : myDate1 : *days ) ) + ' days!' ; // myString = 'there is a difference of 7 days!' /end-free

    via default this will suppress main zeros. youngsters, if you need leading zeros you may also are looking to use %editc in its place of %char, but you'll without delay find anything pleasing:

    /free myString = 'there's a difference of ' + %editc( %diff( myDate2 : myDate1 : *days ) : 'X' ) + ' days!' ; // myString = 'there is a change of 0000000007 days!' /end-free

    The return box for %diff is truly 10 numeric! This capability that in case you need to use leading zeros, and nevertheless are expecting the relevant number of characters, you will need to first circulate the price into an appropriately sized numeric container after which operate %editc. at the start this looks ordinary, in all probability even silly, but when you understand that this BIF, and most others in this article, also observe to %time and %timestamp values, it is handy to conceive of needing 10 digits again.

    RETRIEVE DATE portions

    The %subdt BIF means that you can extract a component of a date box, such as the day, month, or year.

    d myDate s d inz(d'2004-05-01') d days s 2s 0 d months s 2s 0 d years s 4s 0 d myString s 128a /free days = %subdt( myDate : *days ); // days = 1 months = %subdt( myDate : *months ); // months = 5 years = %subdt( myDate : *years ); // years = 2004 *inlr = *on ; /end-free

    you can also use short cuts for the 2nd parameter: *d instead of *days, *m as an alternative *months, and *y as an alternative of *years.

    As I mentioned with %diff above, the use of these consequences in persona strings is no difficulty with %char, but when you utilize %editc you should definitely be conscious that %subdt goes to come a ten-digit numeric.

    WHAT which you could’T DO WITH DATES

    As quality as date operations are in RPG IV, there are some issues that you could’t do as effortlessly as I’d like. i used to be first introduced to actual dates by programming in Java. due to the fact that the variable is definitely an object in Java, you could readily trade the day, month, or 12 months to yet another value with out affecting the leisure of the date subfields. sadly in RPG, you need to do some fancy math or assemble a new date. You also can’t instantly retrieve the day of the week or the name of the day of the week. These elements are fairly commonplace in loads of different languages, but in RPG you'll should find yet another answer.

    fortunately these solutions and extra can be found. There are some nifty SQL solutions, and there are numerous tools purchasable, including my own xRPG Core Library, available for free of charge down load from www.rpgnext.com. basically, concerns with date coping with had been what in the beginning caused me to create my library. V5R2 does have some enhancements to date handling, but they basically revolve around changing from dates to numeric variables.

    Joel Cochran is the director of research and building for a small application enterprise in Staunton, Virginia, and is the writer and writer of www.RPGNext.com. electronic mail: jcochran@itjungle.com


    smo.nu | smonu | programming, ramblings, and brain dumps. |
    king4exam.com | king4exam - find all popular it exam certification study materials here. their expert team is ready to help you to get your certification easily. | king4exam is the most proffessional and reliable it training material and prictice material provider. 100% pass rate and money back guarantee policy. try their free demo to check if that is the right one you want to buy. | exam, practice, certification, dumps, king4exam
    exam2pdf.com | exam2pdf | exam2pdf, certifications it vce to pdf, dumps | dumps, certifications, exam2pdf
    pass4king.net | pass4king latest it certification exam braindumps vce download | free download pass4king testking pass4sure it exam 000-266 dumps vce files. 100% guaranteed latest updated real exam questions and answers, 99.8% pass rate. |
    dumpsportal.com | dumpsportal it certification exam portal | best it certification braindumps portal on web. you can download any exam of your choice without pay any additional charges. dumpsportal.com has over 100 top vendors including microsoft, oracle, cisco, hp, ibm, comptia and many more. | dumps, portal, latest, best, download, braindump, dumpsportal, questions
    vmwarehelpcenter.com | vmware help center - real questions answers 000-266 dumps for vmware exams | |

    RSS Killexams 000-266 dumps

    CNN

    Fox News

    Google News




    Article 1 | Article 2 | Article 3 | Article 4 | Article 5 | Article 6 | Article 7 | Article 8 | Article 9 | Article 10 |
    Back to Exam List


    Exam dumps Books list