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

Sort to have ',' Separated fields..


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Wed Apr 07, 2010 11:05 am
Reply with quote

Hi,
I have data looks as below:Lrecl=80


H04062010AAA
DAABBCCDDEEFFGGHH
T123123123

I want the data as below.
"1st O/P file:"

H,04062010,AAA
D,AA,BB,CC,DD,EE,FF,GG,HH
T,123,123,123


"2nd O/P file"

AADDHH


I am allowed to increase O/P file length due to commas for first case and for second 80 fixed.Could you please advise which way I can achieve this. I don't want the way to separate these 3 types of records into 3 different temp files and do outrec,then merge those three again.


Can you suggest optimized one step for this using icetool.

Thanks..
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Apr 07, 2010 11:23 am
Reply with quote

Hi,

and the rules are ?


Gerry
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 07, 2010 11:32 am
Reply with quote

You also need to tell SORT product installed at your site.
Your previous posts are present both in JCL and DFSORT parts of forum...

and as Gerry as asked
How you arrived at output of second file?
for first output file is the field lengths is is criteria to make it comma separated? If so mention it in detail for each field from header\detail line and trailer.
Back to top
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Wed Apr 07, 2010 12:44 pm
Reply with quote

Hi,
Actually I can use ICETOOL in our system.And Yes, all the data I have shown, you can consider similar calculation for bytes.
For 1st, its just fields of different length for 3 different type of records and need those as "," separated as shown.

For 2 nd its just outrec for (2,2,8,2,16,2) for trailer record i.e. (1,1,EQ,C'T')

But I want to create one step for both..Actually I am in design phase.You please consider no of bytes exactly as shown in example.
My problem is as H,D,T have different fields and they need to comma separated as shown in example, I am not getting how to do that in one step.

Please share your thought on this.
Thanks,
Sid.
Back to top
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Wed Apr 07, 2010 12:47 pm
Reply with quote

Sorry!!Please consider the below line for 2 nd O/P file..I apologize.

For 2 nd its just outrec for (2,2,8,2,16,2) for Detail record i.e. (1,1,EQ,C'D')
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Apr 07, 2010 1:35 pm
Reply with quote

Although you say that you can use ICETOOL for this, ICETOOL may possibly be an alias for the SYNCSORT equivilent, so it would be greatly appreciated if you could perform the step below and clarify exactly which product and release level is being used by running the simple sort step shown below.

If the messages start with ICE then your product is DFSORT and will be moved to the correct forum by one of the moderators. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and the topic will remain in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


Gerry has asked what the rules are, and so far you have not answered him. From what I can see the rules are as clear as mud if they exist at all. Does the subsequent formatting of the records depend on the first character of the record, if so, please explain the rules clearly. If not, then describe in detail how the record needs to be reformatted.

Unless YOU tell us the exact rules we can only guess at what you want to do, and quite frankly I would rather do something else where I know the rules rather than waste my time by guessing at things that you have not told us.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Apr 07, 2010 1:51 pm
Reply with quote

Based on available information most I could do is this... .
Code:

//STEP030  EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
H04062010AAA                                                   
DAABBCCDDEEFFGGHH                                             
T123123123                                                     
//SORTOUT  DD SYSOUT=*                                         
//SORT2  DD SYSOUT=*                                           
//SYSIN DD *                                                   
 SORT FIELDS=COPY                                             
 INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),                         
           BUILD=(1,1,C',',2,8,C',',10,3,80:X)),               
       IFTHEN=(WHEN=(1,1,CH,EQ,C'D'),                         
           BUILD=(1,1,C',',2,2,C',',4,2,C',',6,2,C',',         
           8,2,C',',10,2,C',',12,2,C',',14,2,C',',16,2,80:X)),
       IFTHEN=(WHEN=NONE,                                     
           BUILD=(1,1,C',',2,3,C',',5,3,C',',8,3,80:X))       
 OUTFIL FNAMES=SORT2,REMOVECC,INCLUDE=(1,1,CH,EQ,C'D'),       
        BUILD=(3,2,12,2,24,2,80:X)                             
/*                                                             

SORTOUT will have (output1)
Code:

H,04062010,AAA                   
D,AA,BB,CC,DD,EE,FF,GG,HH         
T,123,123,123                     

SORT2 will have...
Code:

AADDHH
Back to top
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Fri Apr 09, 2010 11:49 pm
Reply with quote

Thanks Guys..The product at my end is DFSORT. I don't know how to move discussion to another section.Please move this one to DFSORT/ICETOOL section.Thanks again..
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 -> DFSORT/ICETOOL

 


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 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
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top