Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Packed decimal, Binary to Numeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Wed May 18, 2011 11:36 pm    Post subject: Packed decimal, Binary to Numeric
Reply with quote

Hi

I need to convert a Packed decimal (Comp-3) [position 33 (length of 9)] and Binary [position 165 (length of 4)] value to Numeric value.

I was requested to use syncsort utility.

My input file is a Vb of record length 1724.

i tried with,

Code:
SORT FIELDS=COPY                                                     
 OUTREC FIELDS=(1,4,33,5,PD,TO=ZD,LENGTH=9,165,2,BI,TO=ZD,LENGTH=4) 


But i'm gettin error as,

Code:

WER161B  ALTERNATE PARM USED                                                 
WER276B  SYSDIAG= 336660, 769107, 769107, 463350                             
WER164B  6,912K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,           
WER164B     0 BYTES RESERVE REQUESTED, 2,470,968 BYTES USED                 
WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED                               
WER108I  SORTIN   : RECFM=VB   ; LRECL=  1724; BLKSIZE= 27998               
WER237I  OUTREC RECORD LENGTH =    17                                       
WER110I  SORTOUT  : RECFM=VB   ; LRECL=    17; BLKSIZE= 27998               
WER410B  5,884K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,     
WER410B     0 BYTES RESERVE REQUESTED, 2,323,512 BYTES USED                 
WER244A  OUTREC - SHORT RECORD                                               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                               


Can someone help me..?


Thanks,
Sab.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed May 18, 2011 11:53 pm    Post subject:
Reply with quote

Hello,

Syncsort topics are discussed in the JCL part of the forum (rather than the DFSORT part of the forum).

It may help if you post the jcl used. The output record is not defined long enough.

Quote:
WER244A [ddname] {INREC,OUTREC} SHORT RECORD

EXPLANATION: The ddname will be SORTOUT, SORTOFxx,
SORTOFx or the ddname provided by an OUTFIL FNAMES parameter.
A variable-length record was too short to contain all the fields specified
on the control statement.
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Thu May 19, 2011 12:00 am    Post subject: Reply to: Packed decimal, Binary to Numeric
Reply with quote

Going forward i'll post in Jcl.. thanks Dick..


Jcl i used,

Code:

//STEP1A EXEC PGM=SYNCSORT                                             
//SORTIN   DD DSN=INPUT-DATASET,DISP=SHR                               
//SORTOUT  DD DSN=OUTPUT-DATASET,DISP=(,CATLG,CATLG),                 
//        DCB=(*.SORTIN),SPACE=(CYL,(100,0),RLSE)                     
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
 SORT FIELDS=COPY                                                     
  OUTREC FIELDS=(1,4,33,5,PD,TO=ZD,LENGTH=9,165,2,BI,TO=ZD,LENGTH=4)   
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Thu May 19, 2011 12:34 am    Post subject: Reply to: Packed decimal, Binary to Numeric
Reply with quote

Quote:
The output record is not defined long enough.


i think the output data can hold in the specified space-DCB.
I have increased the output dataset space upto 500 cyls.. But still i couldn't achieve the desired o/p.
Is ter anything i need to change in the JCL..?


Thanks,
Sab.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu May 19, 2011 12:50 am    Post subject:
Reply with quote

Hello,
Can you try specifying the DCB parameter manually for output dataset and make the LRECL of the dataset be 21? 17 bytes + 4 for VB file.

Please try it and let us know.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu May 19, 2011 12:55 am    Post subject:
Reply with quote

An output record not defined long enough has ABSOLUTELY NOTHING to do with the number of cylinders you allocate. An LRECL that is too short is too short, whether you give the file one track or 500 cylinders.

From your original post:
Code:
WER108I  SORTIN   : RECFM=VB   ; LRECL=  1724; BLKSIZE= 27998               
WER237I  OUTREC RECORD LENGTH =    17                                       
WER110I  SORTOUT  : RECFM=VB   ; LRECL=    17; BLKSIZE= 27998 
Note that an LRECL of 17 means the maximum record length that will be allowed will be 13 bytes due to the record descriptor word that must be allowed for in an VB file.
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Thu May 19, 2011 1:00 am    Post subject: Reply to: Packed decimal, Binary to Numeric
Reply with quote

Thanks Bob,

But what Record length i should give so that i can get the RC00..?

Quote:
Can you try specifying the DCB parameter manually for output dataset and make the LRECL of the dataset be 21? 17 bytes + 4 for VB file


I tried manually overriding the Lrecl to 22 but its not working.


Regards,
Sab.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu May 19, 2011 1:02 am    Post subject:
Reply with quote

Quote:
"I tried manually overriding the Lrecl to 22 but its not working."

Your LRECL was 21 or 22?

Could you show us your changed JCL?

BTW who is Bob? icon_biggrin.gif
Back to top
View user's profile Send private message
sabarikanth

New User


Joined: 07 Jun 2010
Posts: 59
Location: coimbatore

PostPosted: Thu May 19, 2011 1:06 am    Post subject: Reply to: Packed decimal, Binary to Numeric
Reply with quote

vasanthz,
Yes its 21.. Sorry for the typo..

My error message shows it should be of 17 but even if i run with Lrecl=17 i couldnt get the correct ans... icon_sad.gif
Error Message..
Code:

 SORT FIELDS=COPY                                                           
 OUTREC FIELDS=(1,4,33,5,PD,TO=ZD,LENGTH=9,165,2,BI,TO=ZD,LENGTH=4)         
WER161B  ALTERNATE PARM USED                                               
WER276B  SYSDIAG= 227215, 627958, 627958, 429375                           
WER164B  6,912K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,         
WER164B     0 BYTES RESERVE REQUESTED, 2,470,968 BYTES USED                 
WER146B  4K BYTES OF EMERGENCY SPACE ALLOCATED                             
WER108I  SORTIN   : RECFM=VB   ; LRECL=  1724; BLKSIZE= 27998               
WER237I  OUTREC RECORD LENGTH =    17                                       
WER110I  SORTOUT  : RECFM=VB   ; LRECL=    21; BLKSIZE= 27998               
WER462I  OUTPUT LRECL DIFFERS FROM SORTOUT LRECL                           
WER410B  5,884K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,   
WER410B     0 BYTES RESERVE REQUESTED, 2,323,512 BYTES USED                 
WER244A  OUTREC - SHORT RECORD                                             
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                               
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                               


Thanks,
Sab.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu May 19, 2011 12:21 pm    Post subject:
Reply with quote

Your OUTREC specifies build of a record of 17 bytes but your JCL specifies that the SORTOUT DCB has an LRECL of 1724 (because SORTIN has LRECL=1724).

Garry.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu May 19, 2011 8:47 pm    Post subject: Re: Reply to: Packed decimal, Binary to Numeric
Reply with quote

sabarikanth wrote:


[...]

Code:

//STEP1A EXEC PGM=SYNCSORT                                             
//SORTIN   DD DSN=INPUT-DATASET,DISP=SHR                               
//SORTOUT  DD DSN=OUTPUT-DATASET,DISP=(,CATLG,CATLG),                 
//        DCB=(*.SORTIN),SPACE=(CYL,(100,0),RLSE)                     
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
 SORT FIELDS=COPY                                                     
  OUTREC FIELDS=(1,4,33,5,PD,TO=ZD,LENGTH=9,165,2,BI,TO=ZD,LENGTH=4)   


Isn't 1,4 the Record Descriptor Word (two bytes of record-length, two bytes "reserved for system use" (always low-values that I have seen))?

Maybe, if you want the first four bytes of the record, it should be 5,4?

Maybe (guessing) SYNCSORT is ignoring your request here. Then you would only have 13 bytes of record plus your own RDW. Making 17. Like the message says.

Why, if they are all 17 bytes, do you want the output to be variable anyway? Nearly 20% of wasted space?

One thing at a time, I suppose.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu May 19, 2011 9:01 pm    Post subject:
Reply with quote

Quote:
Isn't 1,4 the Record Descriptor Word (two bytes of record-length, two bytes "reserved for system use" (always low-values that I have seen))?
The second two bytes are used for spanned records. I don't remember the codes, but there is one to indicate this record stants in this block but does not end in this block, one that indicates this record ends in this block but does not start in this block, and one that indicates this record neither starts nor ends in this block. For spanned records, the 00 means this record begins and ends in this block, which is pretty much the same meaning as for non-spanned records.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu May 19, 2011 9:11 pm    Post subject: Reply to: Packed decimal, Binary to Numeric
Reply with quote

Thanks Robert. I always wondered about that. Learn something new every day.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts Convert Decimal to hexadecimal Steve Ironmonger DFSORT/ICETOOL 5 Fri May 27, 2016 4:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us