Page 1 of 2
using the display statement
Posted:
Thu Sep 23, 2010 10:59 pm
by nicole
Hi there,
Ok here is my problem. I am sending my report to a CSV file. My one field is not being populated with data, it shows up as gibberish and I am trying to use a display statement to see where I'm going wrong, I think i'm using it in the wrong place in my program.
example:
MOVE CASH-TRANS-NO TO WS-CSV2-SEQ-NUM NW082710
DISPLAY 'WS-CSV2-SEQ-NUM'
This is what it shows me in SDSF when I run this:
TRANS HOLD TRANS BATCH SEQ
CDE *** ERROR MESSAGE *** CD CAT CD DATE NUM NUM
10 NO ACCT 01 C 2031010827 12595
WS-CSV2-SEQ-NUM
10 NO ACCT 01 C 3911350827 17565
In my csv file the seq num is this: ž*
I just want to figure out what I'm transferring. Let me know. Thanks.
Re: using the display statement
Posted:
Thu Sep 23, 2010 11:36 pm
by dick scherrer
Hello,
I suspect that the problem field is defined as packed-decimal or binary.
To create readable numbers in a csv file, use an edited value (i.e. PIC 99999.99-)
Re: using the display statement
Posted:
Fri Sep 24, 2010 12:26 am
by nicole
Ya I think that is what is wrong also, but when I changed it to:
WS-CSV2-SEQ-NUM WS-CSV2-REC +47 05 N MASK (BWZ '99999')
It makes no difference..
I just really need to know where to place my display statements so I know where this field is getting populated. Thanks.
Re: using the display statement
Posted:
Fri Sep 24, 2010 2:57 am
by dick scherrer
Hello,
It makes no difference..
Suggest you show the value in hex both ways.
I just really need to know where to place my display statements so I know where this field is getting populated.
I do not understand this question. Typically, displays are placed before and/or after the feidls to be looked are referenced/modified. The display will not show where the field is poppulsted - you will have to determine this and "display" accordingly.
Possibly i misunderstand. . .
Re: using the display statement
Posted:
Fri Sep 24, 2010 3:02 am
by nicole
Oh ok ya your probably right, I don't know my easytrieve that well. You were correct about that field being packed I'm just looking thru a load of other easytrieve programs to find an example of unpacking a field. Sorry if I wasted your time but do appreciate the help.
Re: using the display statement
Posted:
Fri Sep 24, 2010 3:27 am
by dick scherrer
Hello,
Not a waste
The way to unpack a field is to move it to a field that is zoned-decimal. . .
When creating a csv file to download to Unix or Windows, there should be no packed or binary data.
Re: using the display statement
Posted:
Fri Sep 24, 2010 3:30 am
by nicole
Ya well there is and I don't know why, wish I would of learned easytrieve in school, would of made it way easier.
Later.
Re: using the display statement
Posted:
Fri Sep 24, 2010 5:22 am
by dick scherrer
Hello,
Let me clarify my last post.
If you are writing a csv file to download, you should not define any packed-decimal or binary fields in this output file.
If you are reading a "csv" file that already has packed-decimal and/or binary fields, you will have to move them to another field to "see" them in a display.
What happens if you generate a report? Will this display the data as you want it?
Re: using the display statement
Posted:
Fri Sep 24, 2010 8:22 pm
by nicole
Ok, I know I'm not making myself clear but I will try to explain. There are several reports that this job generates. One of these reports they want sent to them in a CSV file, sent through email. When I move the one field to the appropriate column, all the data comes out as gibberish. This field is already packed. When I view the report on the mainframe it is correct and everything looks normal. Now I understand about what your saying to move them to another field to "see" them in a display, but how do you go about doing that. Is it just another move or do I have to define another field to accept this? Let me know if you can. Thanks again.
Re: using the display statement
Posted:
Sat Sep 25, 2010 4:16 am
by dick scherrer
Hello,
Easytrieve works differently creating a report versus creating a "file".
Suggest you discontinue this "report" and define this as a file instead. The output file should contain what you are looking for.
If not, let me know and we'll proceed from there
Have a great weekend,
d