Page 1 of 2

**Convert PD variable into normal form

PostPosted: Thu May 21, 2009 5:09 pm
by ansh_4702
Hello,

I have an input file of 80 length. right now value from position 14 to 15 is in COMP-3. I want to create a o/p file which will display this comp field value in normal(ZD) form. Meaning the o/p file should indicate the value of COMP field from position 14 to 16. Can anyone help me out on how we could do this thru JCL. I am f=using following control card for this, but from this i am getting value "1 " while i want in the form "001". Please help.

SORT FIELDS=COPY
OUTREC FIELDS=(1,13,
14,3,PD,EDIT=(TTT),
17,64)

Re: **Convert PD variable into normal form

PostPosted: Fri May 22, 2009 12:26 am
by dick scherrer
Hello,

Do you want a cobol solution? Your topic is in the cobol part of the forum. . .

If you intend to use the sort product on your system, which sort product is in use?

If the packed decimal value is in positions 14-15, that would be a length of 2 bytes.

Re: **Convert PD variable into normal form

PostPosted: Fri May 22, 2009 2:38 pm
by ansh_4702
Hi Dick,
I want a JCL for this. Sorry i sent this at the wrong place. We cant use DFSORT here.....

"If the packed decimal value is in positions 14-15, that would be a length of 2 bytes."

Ya....it of two bytes in the i/p file but i want to display the value of this COMP-3 variable in the normal form...so that wud take 3 bytes in the o/p file.

rite now it is having value "001" in COMP-3 format ...i am trying to use the ctlcard i mentioned warlier but from that i am getting "1(space)(space)" ...but i want it to be displayed as"001". Please help.

Re: **Convert PD variable into normal form

PostPosted: Sat May 23, 2009 2:13 am
by dick scherrer
Hello,

JCL cannot do this - only some code can, whether it be the sort, cobol, easytrieve, or whatever.
We cant use DFSORT here.....
What does this mean? The control statements posted look like sort control statements :?

If you post the complete jcl, control statements, and the informational output from the run it may help. Also posting part of the output that shows the problem could help.

Re: **Convert PD variable into normal form

PostPosted: Sat May 23, 2009 1:54 pm
by ansh_4702
Hi Dick,

Actually in the existing JCL we have this step to reformat the rider field from comp to normal....there they have used FILEAID utility in the step.It was a very old job so the ctlcard in this step doesnt exist now. Thats why we want to create a ctlcard ourself to reformat the PD field using some other utility.

Here is the i/p file rec:
01981206955.....RT20071210

the bold field is position 14-15 which is having the comp-3 value that needs to be changed.(001)
now i am using following JCL for this:
//REFMT2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSOUTU DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SNAPDD1 DD SYSOUT=*
//SORTWK01 DD UNIT=SYSWK,SPACE=(TRK,(10,10),RLSE)
//SORTWK02 DD UNIT=SYSWK,SPACE=(TRK,(10,10),RLSE)
//SORTIN DD DSN=KHANDAN.SAMPLE.INPUT,DISP=SHR
//SORTOUT DD DSN=KHANDAN.SAMPLE.OUTPUT,
// DISP=(,CATLG,DELETE),
// UNIT=TEST,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(PTS.MODEL,LRECL=80,RECFM=FB)
//SYSIN DD DSN=KHANDAN.RC.CTLCARD(SORTABC),DISP=SHR
//*

Ctlcard is as follows:

SORT FIELDS=COPY
OUTREC FIELDS=(1,13,
14,3,PD,EDIT=(TTT),
17,64)

The o/p file rec is as follows:
01981206955..1 RT20071210

Thus getting "1_ _" not "001". please see if you can provide some JCL or ctlcard to do this.
Thanks !

Re: **Convert PD variable into normal form

PostPosted: Sat May 23, 2009 9:45 pm
by Anuj Dhawan
Is this JCL not functioning now? As You say:
in the existing JCL we have this step to reformat the rider field
and then this
It was a very old job so the ctlcard in this step doesnt exist now.


In another post you said,
packed decimal value is in positions 14-15
while in your SORT card you use "14,3" :?. If I got your question correctly, try something like:
SORT FIELDS=COPY
OUTREC FIELDS=(1,13,
14,2,PD,TO=ZD,EDIT=(TTT),
17,64)

Re: **Convert PD variable into normal form

PostPosted: Sat May 23, 2009 9:56 pm
by dick scherrer
Hello,

What happens when you specify length 2 rather than length 3 (as mentioned earlier)?

The PD field is 2 bytes, not 3.

Re: **Convert PD variable into normal form

PostPosted: Mon May 25, 2009 3:41 pm
by ansh_4702
Hi Dick,

I tried by your ctlcard,but I got this :

01981206955..01.RT20071210

While I want the out put as:

01981206955..001RT20071210

Re: **Convert PD variable into normal form

PostPosted: Wed May 27, 2009 5:25 pm
by ansh_4702
Hi Dick,
Didnt hear anything back from you ???

Re: **Convert PD variable into normal form

PostPosted: Thu May 28, 2009 3:21 am
by dick scherrer
Hello,

I just noticed that your topic is in the cobol part of the forum :oops:

Does your system use Syncsort (earlier you mintioned that you cannot use DFSORT)?

If this was in the proper sort part of the forum, we'd have more activity.