Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
syncosrt doesn't recognize the digit

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: syncosrt doesn't recognize the digit
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Wed Aug 25, 2010 11:45 pm    Post subject: Reply to: syncosrt doesn't recognize the digit
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    Post subject: Reply to: syncosrt doesn't recognize the digit
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: 578
Location: USA

PostPosted: Thu Aug 26, 2010 12:03 am    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Thu Aug 26, 2010 12:32 am    Post subject:
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: 578
Location: USA

PostPosted: Thu Aug 26, 2010 1:06 am    Post subject:
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    Post subject:
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    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 JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 8 Thu Jun 29, 2017 1:41 pm
No new posts Two digit Date format abdulrafi COBOL Programming 6 Fri May 06, 2016 6:51 pm
No new posts No TSO prefix doesn't get the input boyti ko CLIST & REXX 4 Thu Apr 28, 2016 3:31 pm
No new posts Recognize Enter in Rexx trushant.w TSO/ISPF 19 Mon Aug 11, 2014 4:37 pm
No new posts How to store 2 digit numeric data in ... cnugemini COBOL Programming 4 Thu Jun 26, 2014 8:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us