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

Is there a way to create more than one output record per inp


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

New User


Joined: 16 Mar 2007
Posts: 8
Location: State of Arizona

PostPosted: Tue Dec 16, 2008 4:26 am
Reply with quote

Is there a way to create more than one output record per input record on the "outrec" in iceman? the first outrec pulls from the input, but the remaining are just static records.

I am pulling programs from a source library, capturing the compile proc for that program and creating execute JCL. I was using iceman to do the JCL and it works now, but need to add 2 more records for symbolic
usage.

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

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Dec 16, 2008 5:22 am
Reply with quote

Hi,

if I understood your question correctly this may assist,

Code:
//STEP0001 EXEC PGM=ICEMAN                                           
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                       
REC1                                                                 
REC2                                                                 
REC3                                                                 
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  INREC OVERLAY=(81:SEQNUM,8,ZD)                                     
  OUTFIL IFTHEN=(WHEN=(81,8,ZD,EQ,1),BUILD=(1:01,80,/,               
                 1:C'INSERT1',/,                                     
                 1:C'INSERT2')),                                     
        IFTHEN=(WHEN=NONE,                                           
                BUILD=(1:01,80))                                     
/*                                                                   


After the first REC1, 2 records are added.


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

DFSORT Developer


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

PostPosted: Tue Dec 16, 2008 6:12 am
Reply with quote

Quote:
Is there a way to create more than one output record per input record on the "outrec" in iceman?


The OUTFIL statement can be used to create more than one output record per input record in several ways including the use of / in BUILD, and the use of HEADERx and TRAILERx. How you would do it exactly depends on exactly what you want to do.

If you need more help, give an example of the records in the input file and what you expect for output, and explain the "rules" for getting from input to output.

Gerry,

Your example could be coded more simply as:

Code:

  OPTION COPY                                             
  OUTFIL IFOUTLEN=80,                                     
    IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),           
    IFTHEN=(WHEN=(81,8,ZD,EQ,1),BUILD=(1:1,80,/,           
                 1:C'INSERT1',/,                           
                 1:C'INSERT2'))                           


Of course, that may or may not be what the OP is looking for.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Dec 16, 2008 6:26 am
Reply with quote

Hi,

thanks Frank


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

New User


Joined: 16 Mar 2007
Posts: 8
Location: State of Arizona

PostPosted: Tue Dec 16, 2008 8:58 pm
Reply with quote

This is what works now, but I need to add two more output records containing: // loadlib='xxx.xxx.xxx',
// srclib='xxx.xxx.xxx'

current working:

Code:

//*********************************************************
//*** FORMAT JCL FOR COB3CSQL PROGRAMS TO COMPILE         
//*********************************************************
//COB3CSQL EXEC PGM=ICEMAN,REGION=0M,                     
//            PARM='SIZE=MAX'                             
//SYSOUT   DD SYSOUT=*                                     
//SYSPRINT DD SYSOUT=*                                     
//SORTIN   DD DSN=#SWS.AFS.TRN.PGM.REPORT,DISP=SHR         
//SORTOUT  DD DSN=#SWP.AFS.JCLLIB(COB3CSQL),DISP=SHR       
//SYSIN    DD *                                           
 OUTREC FIELDS=(C'//',23,8,C' EXEC ',23,8,C',MBR=',2,8,C' 
                        ')                                 
 INCLUDE COND=(23,8,CH,EQ,C'COB3CSQL')                     
 SORT FIELDS=COPY                                         
/*
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Dec 16, 2008 10:14 pm
Reply with quote

Carol Mellinger,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
 XXXXXXXX             COB3CSQL                           
 YYYYYYYY             COB3CSQL                           
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  INCLUDE COND=(23,8,CH,EQ,C'COB3CSQL')                   
  OUTFIL OUTREC=(C'//',23,8,C' EXEC ',23,8,C',MBR=',2,8,/,
                 C'// LOADLIB=''',C'XXX.XXX.XXX''',/,     
                 C'// SRCLIB=''',C'XXX.XXX.XXX''')       
/*


The output from this job is

Code:

//COB3CSQL EXEC COB3CSQL,MBR=XXXXXXXX     
// LOADLIB='XXX.XXX.XXX'                 
// SRCLIB='XXX.XXX.XXX'                   
//COB3CSQL EXEC COB3CSQL,MBR=YYYYYYYY     
// LOADLIB='XXX.XXX.XXX'                 
// SRCLIB='XXX.XXX.XXX'                   
Back to top
View user's profile Send private message
Carol Mellinger

New User


Joined: 16 Mar 2007
Posts: 8
Location: State of Arizona

PostPosted: Tue Dec 16, 2008 11:10 pm
Reply with quote

Works great with the exception that I had to change my output record to 37 bytes instead of 80. Instead of using an iebgener to convert to 80 bytes, is there an easier way using ICEMAN?
Error received:
[size=7]ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE222A 0 37 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR SORTOUT
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 E7-K24705
ICE052I 3 END OF DFSORT
[/size]
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Dec 16, 2008 11:24 pm
Reply with quote

Modify this line
Code:
OUTFIL OUTREC=(C'//',23,8,C' EXEC ',23,8,C',MBR=',2,8,/,

AS
Code:
OUTFIL OUTREC=(C'//',23,8,C' EXEC ',23,8,C',MBR=',2,8,80:X,/,
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Dec 17, 2008 12:08 am
Reply with quote

Carol,

If you had just mentioned that your input records were 37 bytes and you wanted output records of 80 bytes, then Kolusu would have shown you how to handle that in the first place. He and everyone else was assuming that your input records were 80 bytes and you never said otherwise. In the future, please give the RECFM and LRECL of your input file and output file so people don't have to make assumptions.
Back to top
View user's profile Send private message
Carol Mellinger

New User


Joined: 16 Mar 2007
Posts: 8
Location: State of Arizona

PostPosted: Wed Dec 17, 2008 1:10 am
Reply with quote

Actually the input was 133 bytes and the output had to be 80 bytes.
I will be more careful next time to include all the facts. - thanks
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top