Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Create multiple rows from 2 rows

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

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Tue Nov 05, 2013 11:06 pm    Post subject: Create multiple rows from 2 rows
Reply with quote

Hi folks,

may you can help me...?

I have an input csv-file FB 80 with two records :

Input:
0;5001;10001;15001;20001;
5000;10000;15000;20000;25000;

I need an output file FB 80 shown below :

Output:
00000 05000
05001 10000
10001 15000
15001 20000
20001 25000

Is it possible with DFSORT or ICETOOL ?

Thanks in advance for help !
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 06, 2013 12:12 am    Post subject:
Reply with quote

oerdgie,

Is it just 2 records or do you have more ? You want transpose records treating them as rows into columns. Is that right?
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Wed Nov 06, 2013 1:08 am    Post subject: Reply to: Create multiple rows from 2 rows
Reply with quote

Hello Skolusu,

yes, there are only two records and I want to transpose them as rows into columns, in pairs.

In words...

Output file:
Record 1 : value 1 from the first record, value 1 from the second record
Record 2 : value 2 from the first record, value 2 from the second record
Record 3 : value 3 form the first record, value 3 from the second record
....and so on
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 06, 2013 1:28 am    Post subject: Re: Reply to: Create multiple rows from 2 rows
Reply with quote

oerdgie wrote:
Hello Skolusu,

yes, there are only two records and I want to transpose them as rows into columns, in pairs.

In words...

Output file:
Record 1 : value 1 from the first record, value 1 from the second record
Record 2 : value 2 from the first record, value 2 from the second record
Record 3 : value 3 form the first record, value 3 from the second record
....and so on


Well you can use RESIZE operator to Merge the 2 records into a single record and then transpose them.

Since you show a 5 byte values you will have a maximum of 13 values to be parsed. I used the REPEAT on parse which is a new feature of DFSORT z/OS V2R1 . If your shop doesn't have it , then you can code 13 parse fields and get the same results.
Code:

//STEP0100 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD *                                                   
0;5001;10001;15001;20001;                                         
5000;10000;15000;20000;25000;                                     
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
  RESIZE FROM(IN) TO(OUT) TOLEN(160) USING(CTL1)                   
//*                                                               
//CTL1CNTL DD *                                                   
  OPTION COPY                                                     
  INREC PARSE=(%01=(ENDBEFR=C';',FIXLEN=05,REPEAT=13)),           
  BUILD=(%01,%02,%03,%04,%05,%06,%07,%08,%09,%10,%11,%12,%13,80:X)
  OUTFIL BUILD=(01,5,X,081,5,/,                                   
                06,5,X,086,5,/,                                   
                11,5,X,091,5,/,                                   
                16,5,X,096,5,/,                                   
                21,5,X,101,5,/,                                   
                26,5,X,106,5,/,                                   
                31,5,X,111,5,/,                                   
                36,5,X,116,5,/,                                   
                41,5,X,121,5,/,                                   
                46,5,X,126,5,/,                                   
                51,5,X,131,5,/,                                   
                56,5,X,136,5,/,                                   
                61,5,X,141,5,/,                                   
                66,5,X,146,5,/,                                   
                71,5,X,151,5,/,                                   
                76,5,X,156,5)                                     
//*                                                               
Back to top
View user's profile Send private message
oerdgie

New User


Joined: 22 Nov 2007
Posts: 55
Location: Germany

PostPosted: Wed Nov 06, 2013 2:44 pm    Post subject: Reply to: Create multiple rows from 2 rows
Reply with quote

Hi Skolusu,

thanks for your solution, it works fine ! icon_smile.gif
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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us