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

Editing Datasets through JCL


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

New User


Joined: 10 Jan 2006
Posts: 76
Location: Germany

PostPosted: Wed Apr 05, 2006 7:14 pm
Reply with quote

Hi all,

Can anyone help me in doing the following:

I have a sequential dataset with records as below:

Code:
ONE
TWO
THREE
FOUR
FIVE


I want to edit the above dataset as below:

Code:
NUMBER 'ONE'
NUMBER 'TWO'
NUMBER 'THREE'
NUMBER 'FOUR'
NUMBER 'FIVE'

I dont know how to include single quotes using IEBGENER utility.(I dont know the escape character to include single quote)

Then How to include the single quote at the end of every record?

Regards,
Antu
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Apr 11, 2006 5:57 pm
Reply with quote

This DFSORT job worked for me:

Code:

//STEP0001 EXEC PGM=SORT                         
//SORTIN   DD   *                                 
ONE                                               
TWO                                               
THREE                                             
FOUR                                             
FIVE                                             
/*                                               
//SORTOUT  DD   SYSOUT=*                         
//SYSOUT   DD   SYSOUT=*                         
//SYSIN    DD   *                                 
  INREC IFTHEN=(WHEN=(2,1,CH,EQ,C' '),           
          OVERLAY=(2:X'7D')),                     
        IFTHEN=(WHEN=(3,1,CH,EQ,C' '),           
          OVERLAY=(3:X'7D')),                     
        IFTHEN=(WHEN=(4,1,CH,EQ,C' '),           
          OVERLAY=(4:X'7D')),                     
        IFTHEN=(WHEN=(5,1,CH,EQ,C' '),           
          OVERLAY=(5:X'7D')),                     
        IFTHEN=(WHEN=(6,1,CH,EQ,C' '),           
          OVERLAY=(6:X'7D'))                     
  OPTION COPY                                     
  OUTFIL OUTREC=(C'NUMBER',X,X'7D',1,6,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: Fri Apr 21, 2006 5:43 am
Reply with quote

With z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) you can do this much more easily using the new JFY function.
Here's two different DFSORT jobs that will do it:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
   OPTION COPY
* Build NUMBER '
   INREC BUILD=(C'NUMBER ''',           
* use JFY to build data'. 
* TRAIL=C'''' puts a ' after the last nonblank of data.
      1,5,JFY=(SHIFT=LEFT,TRAIL=C''''))
/*


Code:

//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
   OPTION COPY
* Use JFY to build NUMBER 'data'.
* LEAD puts NUMBER ' before data.
* TRAIL puts a ' after the last nonblank of data.
   INREC BUILD=(1,13,JFY=(SHIFT=LEFT,LEAD=C'NUMBER ''',
     TRAIL=C''''))                                     
/*


For complete information on the JFY function, see:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
blu_scrin

New User


Joined: 06 Feb 2006
Posts: 2
Location: Phils

PostPosted: Fri Apr 21, 2006 11:31 am
Reply with quote

i don't know how to deal with the qoutes but here is a sample on how to add the word number... I'll get back to you once i Hav learned how to deal with the quotes.

Code:

//IEBGEN01 EXEC PGM=IEBGENER   
//SYSUT1   DD *                 
ONE                             
TWO                             
THREE                           
FOUR                           
FIVE                           
//SYSUT2   DD SYSOUT=*         
//SYSIN    DD *                 
  GENERATE MAXFLDS=2,MAXLITS=80
  RECORD FIELD=(73,1,,8),       
         FIELD=(6,'NUMBER',,1) 
//SYSPRINT DD SYSOUT=*
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: Fri Apr 21, 2006 9:07 pm
Reply with quote

Surrounding the value with apostrophes (i.e. single quotes) without blanks before the ending apostrophe is the tricky part. icon_smile.gif
Back to top
View user's profile Send private message
joelacs1068

New User


Joined: 24 Aug 2006
Posts: 9

PostPosted: Mon Aug 28, 2006 11:48 am
Reply with quote

Can use ` instead of '
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 Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts define 1 DCB parms for multiple outpu... JCL & VSAM 9
No new posts FTP datasets to server CLIST & REXX 13
Search our Forums:

Back to Top