problem with output file



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

problem with output file

Postby Dashimir » Mon Jan 28, 2013 11:49 pm

my output file starts wrong for some lines then it goes ok for all the others. When i chance the input file getting some lines from the boton and puting it on the top everything goes ok and i coudnt find why.

the output file is something like this
                                                                     00000000000   
                                                                     00000000000
Jacinto Pinto Akinokudoi                                661312684321
Jacinto Pinto Akinokudoi                                661312684321
Jacinto Pinto Akinokudoi                                661312684321
Jacinto Pinto Akinokudoi                                661312684321
Jacinto Pinto Akinokudoi                                661312684321

WHEN 'G'                                             
  MOVE NR-PROP-SDV-ENT TO NR-PROP-WS                 
  MOVE NR-PROP-SDV-ENT TO LPARM01                     
  PERFORM R-0666-00-CALL                             
  MOVE LPARM01-D1 TO DV-WS                           
  MOVE NR-PROP-DV TO CONVERSI-NP-WS-2                 
  MOVE CONVERSI-NP-WS-2 TO CONVERSI-NP-WS-3           
  MOVE CONVERSI-NP-WS-3 TO CONVERSI-NUM-PROPOSTA-SIVPF
  DISPLAY CONVERSI-NUM-SICOB                         
  PERFORM R-1000-00-ACESSARTABELAS                   
  MOVE CLIENTES-NOME-RAZAO TO NOME-DET               
  IF CLIENTES-CGCCPF IS NUMERIC                       
     MOVE CLIENTES-CGCCPF TO CPF-CONV                 
  ELSE                                               
     DISPLAY 'CLIENTES-CGCCPF NOT NUMERIC'           
     MOVE ZEROS TO CLIENTES-CGCCPF                   
  END-IF                                             
  MOVE CPF-CONV TO CPF-DET                           

Dashimir
 
Posts: 42
Joined: Wed Dec 26, 2012 7:27 pm
Has thanked: 2 times
Been thanked: 0 time

Re: problem with output file

Postby NicC » Tue Jan 29, 2013 1:34 am

how does that code relate to that output and vice versa?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: problem with output file

Postby Dashimir » Tue Jan 29, 2013 4:43 pm

           DESCRICAO-COD-RETORNO-DET                       
      WHEN 97 MOVE 'Estorno sem cobran a ou erro duplicida
      'de' TO DESCRICAO-COD-RETORNO-DET                   
      WHEN 98 MOVE 'Estorno com cobran a no próximo m s' TO
           DESCRICAO-COD-RETORNO-DET                       
      WHEN 99 MOVE 'Estorno comandado pela Caixa.' TO     
           DESCRICAO-COD-RETORNO-DET                       
    END-EVALUATE                                           
    WRITE REG-SAIDA FROM REG-DETALHE                       
  WHEN 'Z'                                                 
    PERFORM R-9999-00-FINALIZAR                           
END-EVALUATE.                                             
[code][/code]
Dashimir
 
Posts: 42
Joined: Wed Dec 26, 2012 7:27 pm
Has thanked: 2 times
Been thanked: 0 time

Re: problem with output file

Postby prino » Tue Jan 29, 2013 5:09 pm

You're completely clueless, aren't you?

If you're working for one of those companies in that part of the world, maybe you should ask them to give you some proper training, like telling you how to use IBM's Debug Tool, so that you can execute your program statement by statement.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: problem with output file

Postby Robert Sample » Tue Jan 29, 2013 5:19 pm

Dashimir, if you think -- as your post title suggests -- that you are having trouble with your output file, WHY ARE YOU POSTING CODE? The first thing to do is to post the input file using the Code button, and then the output file, using the Code button, and explain why the output file your program produces is not what you expected. Until and unless you post that, nobody here can help you since we do not read minds and have no way of knowing what it is you are attempting to do.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: problem with output file

Postby Dashimir » Tue Jan 29, 2013 5:20 pm

they just lught lol.

the first one come with conversi-num-sicob 000000 i dont know why but when i change the order of the input file everthing goes ok

  EXEC SQL                                                     
        SELECT  NUM_SICOB                                     
          INTO :CONVERSI-NUM-SICOB                             
          FROM  SEGUROS.CONVERSAO_SICOB                       
        WHERE NUM_PROPOSTA_SIVPF = :CONVERSI-NUM-PROPOSTA-SIVPF
  END-EXEC.                                                   
Dashimir
 
Posts: 42
Joined: Wed Dec 26, 2012 7:27 pm
Has thanked: 2 times
Been thanked: 0 time

Re: problem with output file

Postby Dashimir » Tue Jan 29, 2013 5:26 pm

150 file dont know how to post it here correctly
Dashimir
 
Posts: 42
Joined: Wed Dec 26, 2012 7:27 pm
Has thanked: 2 times
Been thanked: 0 time

Re: problem with output file

Postby Robert Sample » Tue Jan 29, 2013 6:12 pm

You post that you have "problem with output file", then you post code. You are told to post the details of what your problem is, and you post SQL code.

You get one more chance, then this topic will be locked as completely a waste of time.

WHAT IS YOUR PROBLEM? Tell us in as simple language as you can what results you are getting and why you think they are not right. If you cannot do this, then we cannot help you.
If you are having trouble with SQL, why post in the COBOL section? If you are NOT having trouble with SQL, why post SQL code?

So far, in several posts, there is no clear statement that there even is a problem, much less what the problem is, much less where the problem lies (COBOL, SQL, file, code, data -- among other possibilities).
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: problem with output file

Postby Dashimir » Tue Jan 29, 2013 6:27 pm

it is hard to explains :S sorry.
the problem is that the first lines of the output file come with empty lines then all the others come ok. When i get 1 line on top of the input file everything goes ok ( my exemple there^^). The lines that weren't processed are processed after i change the first line in the input file with some other line there.

The problem fix when i change the order of the inputfile and i dont know why, i think i will just do that and pretend everything is ok.
Dashimir
 
Posts: 42
Joined: Wed Dec 26, 2012 7:27 pm
Has thanked: 2 times
Been thanked: 0 time

Re: problem with output file

Postby Robert Sample » Tue Jan 29, 2013 8:16 pm

The empty output lines are there because you have coded (or modified) the program incorrectly and the lines are being written by your code. Why, and how, the logic error exists are something that only you -- or someone working at your site -- can possibly pursue since we don't have access to the source code.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post