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

Coverting a variable like s9(7)v99 to 9(7)v99 using SORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
narendraanchala

New User


Joined: 03 Oct 2006
Posts: 7

PostPosted: Fri Feb 23, 2007 2:36 am
Reply with quote

I have a variable like s9(7)v99. I would like to covert it 9(7)v99.
Could anyone please help me how to get this?

Thanks

Narendra.

Title Changed
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Feb 23, 2007 2:51 am
Reply with quote

Hello,

Is this a sort question or a programming question?

If it is a sort question, please post some example input data and what you would like the output to look like.

If yo have some JCL set up, please post that as well.
Back to top
View user's profile Send private message
narendraanchala

New User


Joined: 03 Oct 2006
Posts: 7

PostPosted: Fri Feb 23, 2007 3:35 am
Reply with quote

Hi Dick,

This is a SORT question, not programming one.
The following is the data in the file with S9(7)V99.
00000460{
00000230{
00000230{
00000460{
00000460{
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 3:50 am
Reply with quote

I think DFSORT Smart Tricks has that one, have you looked there?
Back to top
View user's profile Send private message
narendraanchala

New User


Joined: 03 Oct 2006
Posts: 7

PostPosted: Fri Feb 23, 2007 3:57 am
Reply with quote

William,

Could you please send the link of that one.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 4:07 am
Reply with quote

You found the DFSORT/ICETOOL forum, the 4th topic is DFSORT/ICETOOL Reference Material
and it's free for the asking.....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Feb 23, 2007 4:20 am
Reply with quote

Quote:
I have a variable like s9(7)v99. I would like to covert it 9(7)v99.

The following is the data in the file with S9(7)V99.
00000460{


S9(7)v99 and 9(7)v99 are both 9-byte ZD values as far as DFSORT is concerned. I think what you're really asking is how to convert a ZD value with a C sign ('00000460{' = X'F0F0F0F0F0F4F6F0C0') to a ZD value with an F sign ('000004600' = X'F0F0F0F0F0F4F6F0F0').

Here's a DFSORT job that will do it. I assumed your 9-byte ZD value starts in position 11.

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT    DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT  DD DSN=...  output file
//SYSIN     DD *
  OPTION COPY
  INREC OVERLAY=(11:11,9,ZD,TO=ZD,LENGTH=9)
/*
Back to top
View user's profile Send private message
narendraanchala

New User


Joined: 03 Oct 2006
Posts: 7

PostPosted: Fri Feb 23, 2007 4:44 am
Reply with quote

Frank,

I am using the following JCL. Both input and output files has lrecl=135. I am getting error. Could you please correct me if anything is missed in the following JCL.

//STEP010 EXEC PGM=ICEMAN
//SORTIN DD DSN=input
//SORTOUT DD DSN=output
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(25:25,9,ZD,TO=ZD,LENGTH=9)
/*
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Feb 23, 2007 4:47 am
Reply with quote

Do you have at least one space in front of your control cards?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Feb 23, 2007 4:49 am
Reply with quote

Quote:
I am getting error.


Whenever you say this, you need to show the messages you received.

In this case, I can guess that you're missing the leading blank before OPTION and the leading blank before INREC, but it would only be a guess.

When I run your statements with the leading blanks, DFSORT does not give an error.
Back to top
View user's profile Send private message
narendraanchala

New User


Joined: 03 Oct 2006
Posts: 7

PostPosted: Fri Feb 23, 2007 9:13 am
Reply with quote

Frank,

I gave one leading space before Option and Inrec but still I am getting the following error

SYSIN :
OPTION COPY
INREC OVERLAY=(25:25,9,ZD,TO=ZD,LENGTH=9)
*
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000

Could you help me why I am getting this error?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Feb 23, 2007 9:30 am
Reply with quote

Hello narendraanchala,

From your error messages, you are running Syncsort, not DFSORT.

I don't have the Syncsort manual available here. If you reply that you are still looking for the cause of the error, i'll have the material available in the morning and will check it out.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Fri Feb 23, 2007 10:26 am
Reply with quote

Hi There,

For sync sort please use the following sort card. I have checked it & its working fine .

Code:
//SYSIN    DD  *                       
   OPTION COPY                         
   INREC FIELDS=(25:25,9,ZD,M1,LENGTH=9) 
/*                                     
Back to top
View user's profile Send private message
narendraanchala

New User


Joined: 03 Oct 2006
Posts: 7

PostPosted: Fri Feb 23, 2007 10:36 am
Reply with quote

Thanks Ekta.

Its working fine now.

Thanks to every one for your help guys.
Back to top
View user's profile Send private message
narendraanchala

New User


Joined: 03 Oct 2006
Posts: 7

PostPosted: Fri Feb 23, 2007 9:43 pm
Reply with quote

Here is one more JCL

SORT FIELDS=COPY
OUTREC FIELDS=(1:1,24,
25:25,9,ZD,EDIT=(TTTTTTTTT),
34:34,102),CONVERT

Thanks to all for helping me.
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top