**Convert PD variable into normal form



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

**Convert PD variable into normal form

Postby ansh_4702 » Thu May 21, 2009 5:09 pm

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)
ansh_4702
 
Posts: 33
Joined: Thu Jan 08, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: **Convert PD variable into normal form

Postby dick scherrer » Fri May 22, 2009 12:26 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: **Convert PD variable into normal form

Postby ansh_4702 » Fri May 22, 2009 2:38 pm

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.
ansh_4702
 
Posts: 33
Joined: Thu Jan 08, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: **Convert PD variable into normal form

Postby dick scherrer » Sat May 23, 2009 2:13 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: **Convert PD variable into normal form

Postby ansh_4702 » Sat May 23, 2009 1:54 pm

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 !
ansh_4702
 
Posts: 33
Joined: Thu Jan 08, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: **Convert PD variable into normal form

Postby Anuj Dhawan » Sat May 23, 2009 9:45 pm

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)
Anuj
Anuj Dhawan
 
Posts: 273
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: **Convert PD variable into normal form

Postby dick scherrer » Sat May 23, 2009 9:56 pm

Hello,

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

The PD field is 2 bytes, not 3.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: **Convert PD variable into normal form

Postby ansh_4702 » Mon May 25, 2009 3:41 pm

Hi Dick,

I tried by your ctlcard,but I got this :

01981206955..01.RT20071210

While I want the out put as:

01981206955..001RT20071210
ansh_4702
 
Posts: 33
Joined: Thu Jan 08, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: **Convert PD variable into normal form

Postby ansh_4702 » Wed May 27, 2009 5:25 pm

Hi Dick,
Didnt hear anything back from you ???
ansh_4702
 
Posts: 33
Joined: Thu Jan 08, 2009 2:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: **Convert PD variable into normal form

Postby dick scherrer » Thu May 28, 2009 3:21 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post