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

syncosrt doesn't recognize the digit


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

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Wed Aug 25, 2010 11:40 pm
Reply with quote

Hi,
I have a pd field whose content is x'201005119c'.
Code:

 21019
 0051C

I'd like extract the date (20100511) and write it in the output file in the zd format.
The problem is that i can't make sycsort recognize the 5.
it keeps thinking that it is the sign and doesn't write it in the output.
I checked the manual and tried a few things, with no success.
I wonder if someone can help.
Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Aug 25, 2010 11:45 pm
Reply with quote

if <sort> thinks that the 5 should be a <sign> ...
did You specify correctly the lengths ???
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Wed Aug 25, 2010 11:59 pm
Reply with quote

supposing that the field contains

Code:

1359
246C

and that i want to extract the 123456 in a zd format, when i run the following

Code:
  OUTREC=(1,3,PD,EDIT=(TTTTTT))

or
Code:
 OUTREC=(1,3,PD,EDIT=(TTTTTT),LENGTH=6)

the result is 012345.
the 6 never shows up.
thanks.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Aug 26, 2010 12:03 am
Reply with quote

jctgf,
3 byte PD can only store maximum of 5 digits. half byte for each digit and last half byte for sign.

Browse your file in File Aid and you will see that 6 is shifted (or displayed under) next field.

Thanks,
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Thu Aug 26, 2010 12:25 am
Reply with quote

hi,

i got this:

Code:
  SORT FIELDS=COPY                         
  INREC FIELDS=(1,4,PD,TO=ZD,LENGTH=7)     
  OUTFIL FNAMES=SORTOUT,                   
    OUTREC=(1,6)                           


i wonder if someone knows how to write in a zd format only the nTH digit (4th, for example) of an input pd field.

thanks.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 26, 2010 12:32 am
Reply with quote

???WTF???

you are showing us a 4 byte PD field. when you go 1,3 that makes no sense.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Aug 26, 2010 1:06 am
Reply with quote

jctgf,
Quote:
i wonder if someone knows how to write in a zd format only the nTH digit (4th, for example) of an input pd field.

Change your OUTREC to
Code:
OUTREC=(4,1)


Thanks,
Back to top
View user's profile Send private message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Thu Aug 26, 2010 2:34 am
Reply with quote

hi,

thanks for the interest.

Quote:

i wonder if someone knows how to write in a zd format only the nTH digit (4th, for example) of an input pd field.


this last question referred to a solution different from the one i posted.

i'll explain:

the input file has a pd field whose content is:

Code:

13579
2468C


pls, suppose the three 1st bytes contain a date (123456).

i'd like to write this date in the output file in the zd format:

Code:
123456
FFFFFF


if i do

Code:
outfil fnames=sortout,
   outrec=(1,3,pd,edit=(tttttt))


the date written in the outfile will be
Code:

12345
FFFFF

no matter what i do, sort will always consider the 2nd half
Code:
6
of the 3rd byte
Code:
5
6

as the signal.

i could do


Code:
 outfil fnames=sortout,
   outrec=(1,3,pd,edit=(tttttttt))


and the result would be

Code:
1234567
FFFFFFF

in this case, the 6 has been written but the 7 has also been.

what i'd like to do is to write only digits 1 to 6 of the input field (that are in bytes 1 to 3).

i wonder if it can be done only with an outrec statment, but without the inrec.

thanks for the patience.
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, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
No new posts JES2 doesn't honor the priority of th... JCL & VSAM 8
No new posts Two digit Date format COBOL Programming 6
No new posts No TSO prefix doesn't get the input CLIST & REXX 4
No new posts Recognize Enter in Rexx TSO/ISPF 19
Search our Forums:

Back to Top