View previous topic :: View next topic
|
Author |
Message |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
My input file has data "0" for variable - KIN-number.
When i generating the report for the same, it is showing Spaces for that value.
I need to display "0" in the report.
My definition:
KIN-NUMBER 40 5 N 0
Regards,
Krunal Bafna |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
KIN-NUMBER 40 5 N 0 MASK('ZZZZ9') |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Hi,
I used the above method, still the same. I am getting the same output. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Show your source. |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
I cannot show my source due to security.
I read my input file and my defination is as said by you.
But while generating report it is showing spaces. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I cannot show my source due to security. |
when asking for help You are supposed to provide the info requested!
if You are not willing to do it Your chances if getting help are pretty slim!
nobody asked You to post ALL the code, just a significant excerpt of it,
if Your security requirement are so tight , You should refrain from asking for help on a public forum for such issues
Quote: |
I read my input file and my defination is as said by you. |
review Your point of view, when doing a problem determination
I said, You said, I checked, ... are not acceptable terms
we believe what we see and advice accordingly ! |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Ok I will provide you some code:
File defination:
FILE RSTATFLE FB (0 0)
RUN-DATE 1 10 A HEADING +
(' RUN ' ' DATE ' '----------')
RUN-MO 1 2 A
YR 9 2 A
KIN-NUMBER 14 5 N 0 MASK ('ZZZZ9') HEADING +
('KIN' 'Number' '--------')
Report :
PRINT REPORT2
REPORT REPORT1F PRINTER WREPORT1 DTLCTL EVERY TALLYSIZE 4 +
LINESIZE 132 SPACE 3 NODATE NOADJUST
*
TITLE 01 W-RPT1-HDR1 +6
TITLE 02 W-RPT1-HDR2
TITLE 03 W-RPT1-HDR3
TITLE 05 COL 35 'INPUT DATASET IS:' W-DSN
TITLE 08 COL 22 'DAILY TOTALS' +
COL 84 'RUNNING TOTALS'
*
LINE 01 RUN-DATE +
KIN-RUN-EMAIL-ELIG +
KIN-RUN-EMAIL-YES +
KIN-RUN-EMAIL-NO +
KIN-RUN-PENETRATION +
KIN-DATE-EMAIL-ELIG +
KIN-DATE-EMAIL-YES |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
i dont see KIN-NUMBER in your report definition. |
|
Back to top |
|
|
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
Ok I will provide you some code:
File defination:
FILE RSTATFLE FB (0 0)
RUN-DATE 1 10 A HEADING +
(' RUN ' ' DATE ' '----------')
RUN-MO 1 2 A
YR 9 2 A
KIN-NUMBER 14 5 N 0 MASK ('ZZZZ9') HEADING +
('KIN' 'Number' '--------')
Report :
PRINT REPORT2
REPORT REPORT1F PRINTER WREPORT1 DTLCTL EVERY TALLYSIZE 4 +
LINESIZE 132 SPACE 3 NODATE NOADJUST
*
TITLE 01 W-RPT1-HDR1 +6
TITLE 02 W-RPT1-HDR2
TITLE 03 W-RPT1-HDR3
TITLE 05 COL 35 'INPUT DATASET IS:' W-DSN
TITLE 08 COL 22 'DAILY TOTALS' +
COL 84 'RUNNING TOTALS'
*
LINE 01 RUN-DATE +
KIN-NUMBER +
KIN-RUN-EMAIL-YES +
KIN-RUN-EMAIL-NO +
KIN-RUN-PENETRATION +
KIN-DATE-EMAIL-ELIG +
KIN-DATE-EMAIL-YES |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Now show some output from your last post (where you included KIN-NUMBER). And why do you use DTLCTL without a CONTROL statement? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You print REPORT2, but you have shown REPORT1F. Maybe you just picked the wrong bits of code? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Good morning Bill,
that is very sharp. Failed to see that one. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Good morning Peter. Hectic day yesterday. Woke up later than usual.
Spot not necessarily significant, but it is possible he's looking in the wrong places. Can't see how what he has coded will fail. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
krunalbafna wrote: |
[...]
Code: |
FILE RSTATFLE FB (0 0)
RUN-DATE 1 10 A HEADING +
(' RUN ' ' DATE ' '----------')
RUN-MO 1 2 A
YR 9 2 A
KIN-NUMBER 14 5 N 0 MASK ('ZZZZ9') HEADING +
('KIN' 'Number' '--------') |
[...] |
Krunal,
A couple of things here.
You have a RUN-DATE, which I always like to see.
However, you are "redefining" the position in the file for the first two characters to be RUN-MO, which I'm assuming is month. Just checking that you are having "US-style" dates, (MMDDYY) not "European" (DDMMYY).
Code: |
FILE RSTATFLE FB (0 0)
RUN-DATE * 10 A HEADING +
(' RUN ' ' DATE ' '----------')
RUN-MO RUN-DATE 2 A
YR RUN-DATE +8 2 A
KIN-NUMBER 14 5 N 0 MASK ('ZZZZ9') HEADING +
('KIN' 'Number' '--------') |
If you note the changes I have made to your date field, including the *, you can consider if the knowledge is useful to your future efforts.
I always generated the file layouts for Easytrieve. And using the "*" format. The "*" says, use the next byte that hasn't already got a name. Saves a lot of counting. Easytrieve supply a record layout generator, but last time I saw it it was pretty dumb. Cobol listing and a bit of rexx, unless you have something cleverer which is able to generate Cobol layouts from designs, so can be exteneded to do Easytrieve as well (like a Data Dictionary).
The advantage of the "*" notation is that you can copy blocks from your input files to temporary files without having to worry about changing the start positions (just change the data-name prefixes, which I note you don't have - never use "qualification", that was something for the punched-card era). |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
just change the data-name prefixes
|
Well you can always prefix fields with the filename, if you use same name fields for different files. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Mmmm... that's thar's qualification, that be, Peter. Never liked them, never will. Particularly as you get the implicit qualification. Then someone decides they know which one the compiler is using, and they're looking at the wrong one.
OK, you can't avoid with things like record-length, file-status, but that's the only sort of place I'd use them.
I like macros for record layouts as well. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Belatedly (very) realised this should be with the CA stuff, not the Compuware, if soom kind Moderator is passing this way. Thanks. |
|
Back to top |
|
|
|