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
 
SORT issue when pivoting data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Tue Apr 01, 2008 3:53 am    Post subject: SORT issue when pivoting data
Reply with quote

Hello All,

I am trying to pivot the data from multiple fields and then I am sorting them. The sort works fine but it gives some unwanted character on the same line.

Let me explain further. I have an input file which has three fields.

NAME1 from 1 to 30
NAME2 from 31 to 70
NAME3 from 71 to 130.

I use the below JCL step to sort the data from the input file and then merge it into a single field of length 100.

//RUN001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DISP=SHR,DSN=Z930028.NAMEXREF.TEST.INPUT
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE),DISP=(,DELETE)
//OUT DD DSN=Z930028.SPLIT.NAMES.TEMP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(10,10),RLSE),
// DCB=(LRECL=100,BLKSIZE=0,RECFM=FB,DSORG=PS)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1,60,CH) FIRST
/*
//CTL1CNTL DD *
OUTFIL FNAMES=T1,OUTREC=(1,30,/,31,40,/,71,60)
/*

And in the output I get as

EDIT Z930028.SPLIT.NAMES.TEMP Columns 00001 00072
****** ***************************** Top of Data *****************************
==MSG> -CAUTION- Data contains invalid (non-display) characters. Use command
==MSG> ===> FIND P'.' to position cursor to these
000001 FIRSTNAME1 156
000002 FIRSTNAME10
000003 FIRSTNAME100
000004 FIRSTNAME1000 ME158
000005 FIRSTNAME10000
000006 FIRSTNAME1001
000007 FIRSTNAME1002 E160
000008 FIRSTNAME1003

I was not expecting to see 156, ME158 etc on the records. I do not have any record in the input as
FIRSTNAME1 156
I get this issue when the records in the input file are more than 9K. Even after running the JCL multiple times, I always get the same result.

Could any one suggest, what I can do to avoid the extra data in the output.

Thanks.

Sudhir
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Apr 01, 2008 4:53 am    Post subject:
Reply with quote

Have you dumped/displayed the original input to see if the unexpected output is actually in the input?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Apr 01, 2008 5:14 am    Post subject:
Reply with quote

Since I don't know what your input records look like, it's difficult to say what's happening. I ran something like what you said you had and didn't get the result you got.

One thing I noticed is that you're building a 60-byte record with the COPY operator, but then you're using LRECL=100 for the SELECT output. You might try changing your OUTFIL statement to the following so the two output LRECLs match:

Code:

   OUTFIL FNAMES=T1,OUTREC=(1,30,100:X,/,31,40,/,71,60)


I don't know if that has anything to do with what you're seeing, but it's worth a try.

If that's not it, then I agree with CICS guy that you should take a look at your input records.

I'd need to see your DFSMSG output and have some idea of what's actually in your input records to help you any more with this.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Tue Apr 01, 2008 5:55 am    Post subject: Re: SORT issue when pivoting data
Reply with quote

sudhirk63 wrote:
EDIT Z930028.SPLIT.NAMES.TEMP Columns 00001 00072
****** ***************************** Top of Data *****************************
==MSG> -CAUTION- Data contains invalid (non-display) characters. Use command
==MSG> ===> FIND P'.' to position cursor to these
000001 FIRSTNAME1 156
000002 FIRSTNAME10
000003 FIRSTNAME100
000004 FIRSTNAME1000 ME158
000005 FIRSTNAME10000
000006 FIRSTNAME1001
000007 FIRSTNAME1002 E160
000008 FIRSTNAME1003
Sudhir,

Didn't you notice that what you posted did not look anything like what you intended?
You did preview it first, didn't you?
What you intended was this:
Code:
==MSG> -CAUTION- Data contains invalid (non-display) characters. Use command 
==MSG>           ===> FIND P'.' to position cursor to these                   
000001 FIRSTNAME1                                                  156       
000002 FIRSTNAME10                                                           
000003 FIRSTNAME100                                                           
000004 FIRSTNAME1000                                               ME158     
000005 FIRSTNAME10000                                                         
000006 FIRSTNAME1001                                                         
000007 FIRSTNAME1002                                               E160       
000008 FIRSTNAME1003                                                         
.......0000000001111111111222222222233333333334444444444555555555566666666667
.......1234567890123456789012345678901234567890123456789012345678901234567890
(I added the column counts)
Next time post 'code' with the code tags........
Looks like Franks solution should work, getting rid of the possibility of garbage in undefined portions of the output record......
Back to top
View user's profile Send private message
sudhirk63

New User


Joined: 08 Oct 2006
Posts: 19
Location: Bangalore

PostPosted: Wed Apr 02, 2008 6:51 pm    Post subject: Reply to: SORT issue when pivoting data
Reply with quote

Thanks Frank , your solution worked.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

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