Start clause

370 pts.
Tags:
COBOL
COBOL Programs
What will be equivalent work query for this start clause in COBOL program? key fields: - key1 = '01' (alphanumeric) key2 = '001' (alphanumeric) key3 = 19500101 (numeric) file name :- L-FILE :- START L-FILE key NOT < EXTERNALLY DESCRIBED KEY. Read L-FILE. Kindly describe the function of start clause also.

Software/Hardware used:
AS400, os400, cobol400,

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta

    What query product are you working with? The equivalent would be different in different query products. Also, what is the data type  and precision and scale of KEY3? A correct query can't be known without knowing the data type and size. "Numeric" is not sufficient.

    And the START statement is described in the COBOL Reference manual portion of the Information Center. The statement that you included in your question would be invalid; it has a syntax error in the KEY clause.

    Tom

    125,585 pointsBadges:
    report
  • Durgesh813
    dont know much about the query product but it is we are using defualt runqry for the and wrkqry commands to create query first and then run query.

    field length and data type are as described:-

    length is 8 
    data type is S(zoned)...

    the main problem is that when i am using start cluase and retrieving data from it i am getting different data as compared to the query which create on the file. through work query...

    i am selecting records by creating query which is 

    KEY1 >= '01'
    KEY2 >='001'
    KEY3 >= 19500101

    is this information sufficing the situation..


    370 pointsBadges:
    report
  • TomLiotta

    If you use the WRKQRY command, it's the basic Query for i5/OS product.

    Unfortunately, you shouldn't test each key field separately. You should concatenate your values together and test that result against the three key fields concatenated together. If you test them separately, the second and third test values must be lower than the lowest key field values for all later keys.

    Since key1 and key2 look potentially to be the lowest values for those fields, the key3 value would be the important one. As long as no key3 value is lower than 19500101, separate tests would be okay.

    Tom

    125,585 pointsBadges:
    report
  • Durgesh813
    Tom thanks for explaining but I have few more doubts if you can clear that.

    I will write down the command which I am using and then the query which I am running and and the difference of the record which i am getting through start clause and runqry command.

    START CLAUSE:-
    [ KEY VALUES:- key1 = '01'(alpha numeric), key2 = '001'(alpha numeric), key3 = 1950 (numeric) ]

    START  L-FILE  KEY  NOT LESS THAN EXTERNALLY DESCRIBED KEY.

    [ the first record which I am getting after reading the L-FILE  values :-
    KEY1 = '01', KEY2 = '002', KEY3 = 20010101. ]

    but when I am using command:-
    RUNQRY *n L-FILE   RCDSLT(*YES).

               KEY1   GE     '01'
    AND   KEY2   GE     '001'
    AND   KEY3   GE     19500101

    it is showing many records out of which the first record  values :-

    KEY1 = 01   KEY2= 001  KEy3 =   20010101...

    so my doubt is when the L-FILE contains a record with KEY2 valuing 001 why is it fetching KEY2 valuing 002 from start cluase....

    what can be the possible reasons...




    370 pointsBadges:
    report
  • Durgesh813
    KEY3 value is 19500101... i have by mistake written 1950 for the start cluase.
    370 pointsBadges:
    report
  • TomLiotta

               KEY1   GE     ’01′
    AND   KEY2   GE     ’001′
    AND   KEY3   GE     19500101

    As I already said, you can't do that and expect it to work. You have to test them as a single value. You can't test the three of them separately.

    Tom

    125,585 pointsBadges:
    report
  • Durgesh813
    okk i got it now, but how to test them as a single value... i don't know the way... kindly guide me
    370 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following