IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Packed decimal, Binary to Numeric


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Wed May 18, 2011 11:53 pm
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
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
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: 1744
Location: Tirupur, India

PostPosted: Thu May 19, 2011 12:50 am
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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu May 19, 2011 12:55 am
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
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: 1744
Location: Tirupur, India

PostPosted: Thu May 19, 2011 1:02 am
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
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

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Thu May 19, 2011 12:21 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 19, 2011 8:47 pm
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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu May 19, 2011 9:01 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 19, 2011 9:11 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Help required to reset decimal points... DFSORT/ICETOOL 10
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts small int to zoned decimal conversion DFSORT/ICETOOL 3
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Mainframe Dataset Binary or ASCII Mainframe Interview Questions 4
Search our Forums:

Back to Top