Page 1 of 2

Difference between PICIN and PICOUT

PostPosted: Mon Apr 18, 2011 7:20 pm
by ankita awasthi
Hi,
Both PICIN and PICOUT contain same value (Picture clause of the field variable) then what is the difference in those?

Re: Difference between PICIN and PICOUT

PostPosted: Mon Apr 18, 2011 7:48 pm
by Robert Sample
PICIN and PICOUT do not have to be the same. One applies to the data field being input and one applies to the data field being output.

Re: Difference between PICIN and PICOUT

PostPosted: Tue Apr 19, 2011 11:34 am
by mongan
For example your picout may be a formatted field like zz.zz9,99-.

Re: Difference between PICIN and PICOUT

PostPosted: Wed Apr 20, 2011 9:00 pm
by ankita awasthi
Thanks for your reply but can you please explain it with example?

Re: Difference between PICIN and PICOUT

PostPosted: Wed Apr 20, 2011 9:09 pm
by NicC
MOVE PICIN TO WS-SOMETHING
MOVE WS-SOMETHING-ELSE TO PICOUT

What else? Or explain yourself more clearly.

Re: Difference between PICIN and PICOUT

PostPosted: Wed Apr 20, 2011 9:19 pm
by Robert Sample
A COBOL example:
PICOUT='Z,ZZ9.99',PICIN='X(08)'
You've got a field that has two decimal places and 4 digits before the decimal. When your program puts the data into the map, it'll be right justified with a decimal point and comma. When you read that field back, the user may have the data left justified with no comma -- so if you read it as 'Z,ZZ9.99' you're going to get an abend code in CICS. You'll take the PICIN variable and convert the value to a number (either yourself or through a function or CICS call).

Re: Difference between PICIN and PICOUT

PostPosted: Thu Apr 21, 2011 6:38 pm
by Suny
Whats the significance of PIC Z,ZZ9.99 ? The comma here has no significance except the display element. so if you move on a variable with 9(4)V99 to this variable , Lets suppose you move 1234.56 to PIC Z,ZZ9.99, it would be displayed as 1,234.99.

Now your PIC in is X(08). So the program will accept this a PIC X(08) only whatever you put in it. You cannot move PICIN to PICOUT directly since the format does not support. therefore you need to do some data manipulation in your program. Of course if you do nothing with the data, and MDT is on so that program receives the data and then send the data back, it will abend if you have a comma as input in x(08).

Re: Difference between PICIN and PICOUT

PostPosted: Sat Apr 23, 2011 3:14 pm
by ankita awasthi
Hey thnx to all now it is very much clear:)

Re: Difference between PICIN and PICOUT

PostPosted: Sat Apr 23, 2011 6:30 pm
by Robert Sample
Suny, I think it would behoove you to learn something about CICS before posting in a CICS forum.

You never need to move PICIN to PICOUT -- or PICOUT to PICIN -- since they are the same field and occupy the same bytes of memory. If you are writing CICS programs that do things like this, you completely wasted whatever money you spent to learn CICS.

Stating a program will abend due to a comma in a PIC X variable indicates you know nothing about COBOL, either. A PIC X variable can contain numeric, alphabetic, special character, and even non-printing characters -- any of the possible 256 EBCDIC bytes can be placed in a PIC X variable. A CICS program will not abend just because a comma is in a PIC X(08) variable.

Also, research BIF DEEDIT in a CICS Application Programming Reference manual or NUMVAL in a COBOL Language Reference manual. Both of these can be used to process the PICIN X(08) variable -- or reference modification could be used, not to mention an array to handle each byte seperately.

And I explicitly stated processing of the PICIN variable would be needed. The original question was when would different PICIN and PICOUT be used and I gave an example. The original question did not mention MDT so your adding it the equation changes the original question to something different.

Re: Difference between PICIN and PICOUT

PostPosted: Sat Apr 23, 2011 11:53 pm
by Suny
Hi,
i know that PICIN and PICOUT would be the same memory (variable) in the symbolic map. What I was trying to explain is if your field is defined as alphnumeric and numeric-edited both (in this case as well as redefines), it will throw out error if try inserting some characecter not supported by numeric and then read it using numeric field (as in your example of PICIN and PICOUT). You only need to make them compatible in your program.

and thanks for pointing out some info.. i will surely go thru them :)