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
 

 

Editing Datasets through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Editing Datasets through JCL
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

Moderator Team Head


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

PostPosted: Tue Apr 11, 2006 5:57 pm    Post subject: Re: Editing Datasets through JCL
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 Moderator


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

PostPosted: Fri Apr 21, 2006 5:43 am    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
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    Post subject:
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 Moderator


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

PostPosted: Fri Apr 21, 2006 9:07 pm    Post subject:
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    Post subject:
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    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 DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts Finding unreferenced datasets without... Alan Playford JCL & VSAM 5 Tue Jul 12, 2016 9:07 pm
No new posts BDW in VB datasets harisukumaran JCL & VSAM 5 Sat May 28, 2016 9:46 am
No new posts How to sync memebers in some datasets... Lord.of.Wind Compuware & Other Tools 2 Thu Apr 21, 2016 12:48 pm


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