Page 1 of 1

Copying from a VB file

PostPosted: Mon Feb 21, 2011 4:54 pm
by Sgiri1
Hi Team,

I have a VB file with comp-3 (at 347th bit) value which needs to be converted to comp, the rest of the contents needs to be copied from the input as it is.
I am using the below sort card but i am not able to process it.

Sort card :

OPTION COPY
INREC FIELDS=(1,4,347,5,PD,TO=BI,LENGTH=9)

Re: Copying from a VB file

PostPosted: Mon Feb 21, 2011 4:59 pm
by NicC
Why are you not able to process it? In other words, what is your error message? And what sort product are you using?

Re: Copying from a VB file

PostPosted: Mon Feb 21, 2011 5:03 pm
by Sgiri1
Nic,

I am using PGM=SORT.

and i am getting the following error messages


ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 11:01 ON MON FE
OPTION COPY
INREC FIELDS=(1,4,347,5,PD,TO=BI,LENGTH=9)
ICE201I G RECORD TYPE IS V - DATA STARTS IN POSITION 5

Re: Copying from a VB file

PostPosted: Mon Feb 21, 2011 5:07 pm
by NicC
None of those are error messages. And PGM=SORT does not show which sort product you have. You are actually using DFSORT as is determined from the ICExxxx messages.

Re: Copying from a VB file

PostPosted: Mon Feb 21, 2011 5:19 pm
by Sgiri1
It is abending with ABEND CODE=S0C7 and as you said I am using DFSORT.

But, I would like to understand the sort card better

INREC FIELDS=(1,4,347,5,PD,TO=BI,LENGTH=9)

1,4 => do we give for all the Variable block files ?

Where do we mention in the sort card to copy the remaining fieds?

Re: Copying from a VB file

PostPosted: Mon Feb 21, 2011 5:29 pm
by prino
Sgiri1 wrote:It is abending with ABEND CODE=S0C7 and as you said I am using DFSORT.


In other words, you are trying to convert something that does not contain numerical data.

Re: Copying from a VB file

PostPosted: Mon Feb 21, 2011 7:44 pm
by steve-myers
An S0C7 ABEND indicates you specified packed decimal data, and the data area does not contain packed decimal data.

Re: Copying from a VB file

PostPosted: Mon Feb 21, 2011 11:50 pm
by Frank Yaeger
It is abending with ABEND CODE=S0C7 and as you said I am using DFSORT.

But, I would like to understand the sort card better

INREC FIELDS=(1,4,347,5,PD,TO=BI,LENGTH=9)

1,4 => do we give for all the Variable block files ?

Where do we mention in the sort card to copy the remaining fieds?


Your INREC statement tells DFSORT that the output record should contain the RDW (in positions 1-4) and the converted 9 byte field.
347,5 means that the PD field starts in position 347 (counting the RDW in position 4). The 0C7 indicates you either got the positions for the PD field wrong, or there are invalid PD values in those positions.

You are not telling DFSORT to copy the remaining fields. If you want to insert the converted field and then copy the original data after it, the INREC statement would be:

  INREC FIELDS=(1,4,347,5,PD,TO=BI,LENGTH=9,5)


If you want to do something else, you need to explain exactly what it is you want to do.

But you really need to understand DFSORT syntax before you can use it effectively. I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080

Re: Copying from a VB file

PostPosted: Tue Feb 22, 2011 1:26 am
by dick scherrer
Hello,

Just curious, but why is there a "requirement" to change comp-3 (packed-decimal) data to binary :?

Re: Copying from a VB file

PostPosted: Tue Feb 22, 2011 5:15 am
by prino
dick scherrer wrote:Just curious, but why is there a "requirement" to change comp-3 (packed-decimal) data to binary :?


Because the OP's management says so!