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 First Line alone

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

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Mon Nov 24, 2014 6:30 pm    Post subject: Editing First Line alone
Reply with quote

I'm facing below challenge.

Code:
//SRT02#20 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                                                               
//SORTIN   DD *                                                     
JOBLWACA WAS EXPANDED USING PRIVATE LIBRARY AAA.BBB.CCC
DLYSTRT WAS EXPANDED USING PRIVATE LIBRARY DDD.EEE.FFF
CACS WAS EXPANDED USING PRIVATE LIBRARY GGG.HHH.III
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD  *                                                     
  OPTION COPY                                                   
  OUTREC PARSE=(%01=(STARTAFT=C'PRIVATE LIBRARY ',FIXLEN=30)),       
  BUILD=(1:C'    DD DISP=SHR,DSN=',%01)                       
/*   



Output:
DD DISP=SHR,DSN=AAA.BBB.CCC
DD DISP=SHR,DSN=DDD.EEE.FFF
DD DISP=SHR,DSN=DDD.EEE.FFF

I want to input these DD's to ISRSUPC in batch mode.

I want output like below

NEW DD DISP=SHR,DSN=AAA.BBB.CCC
DD DISP=SHR,DSN=DDD.EEE.FFF
DD DISP=SHR,DSN=DDD.EEE.FFF

Could any one help me in inserting string "NEW" alone in 1st line.

LRECL = 150, FB In/Output files
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Nov 24, 2014 7:47 pm    Post subject: Reply to: Editing First Line alone
Reply with quote

Put your PARSE and BUILD each within an IFTHEN=(WHEN=INIT.

Amend the BUILD to temporarily extend the records with a sequence number.

Use IFTHEN=(WHEN=(logical-expression to test the sequence number for a value of one. Use OVERLAY to put "NEW" or whatever where you want.

Use IFOUTLEN=original-record-length to chop your records back to original size.
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Tue Nov 25, 2014 11:29 pm    Post subject:
Reply with quote

Hi Bill,

I have searched forum, am not successful in getting exact example. Building temporary seqnum and checking in same sort card

Kindly share any example or link for my better understanding and for coding.

Thanks much for understanding icon_smile.gif
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Tue Nov 25, 2014 11:51 pm    Post subject:
Reply with quote

Hi Bill,

Do I need to use something like below
Code:
//SYSIN    DD *                                                         
        SORT FIELDS=COPY                                               
         INREC IFTHEN=(WHEN=INIT,OVERLAY=(150:SEQNUM,3,ZD)),         
               IFTHEN=(WHEN=(150,3,CH,EQ,C'001'),                         
                         OVERLAY=(3:3,3,CH,EQ,C'NEW'))       
        OUTREC IFTHEN=(WHEN=INIT,PARSE=(%01=(STARTAFT=C'PRIVATE LIBRARY ',FIXLEN=30)),       
  BUILD=(1:C'    DD DISP=SHR,DSN=',%01))


Correct me if am wrong anywhere
My files has 150 fb as properties.
And I don't understand IFOUTLEN=original-record-length to chop your records back to original size.

Please explain

Code'd
Back to top
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 61
Location: India

PostPosted: Wed Nov 26, 2014 1:37 pm    Post subject:
Reply with quote

Hi Basha,

Please try this.

Code:
//SYSIN    DD  *                                             
  OPTION COPY                                                 
  OUTREC IFTHEN=(WHEN=INIT,                                   
      PARSE=(%01=(STARTAFT=C'PRIVATE LIBRARY ',FIXLEN=30)),   
      BUILD=(1:C'    DD DISP=SHR,DSN=',%01,52:SEQNUM,3,ZD)), 
         IFTHEN=(WHEN=(52,3,ZD,EQ,1),OVERLAY=(1:C'NEW ')),   
         IFOUTLEN=51                                         
/*                                             



By the way, why are you defining SEQNUM as CH ??
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Wed Nov 26, 2014 2:43 pm    Post subject:
Reply with quote

Hi Arun,

OMG it just worked on a single run. I was breaking my head from two days since am new.

Thanks a million for your code.

Really I have learnt a lot since I registered in this forum.

Thanks Arun and Bill:)
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Nov 26, 2014 3:10 pm    Post subject: Reply to: Editing First Line alone
Reply with quote

Arunkumar Chandrasekaran,

For a ZD sequence number a character comparison will probably execute faster. That's why I use it :-)

Khadhar Basha,

IFOUTLEN= says "at the end of IFTHEN=(WHEN processing, set the record-length of the current record to this value". It is sometimes required, for complex IFTHEN usage, and often useful, to cut of temporary data in fixed-length records which is only used within that operator (if only used within INREC, or only OUTREC, or only OUTFIL) use IFOUTLEN rather than a BUILD (which requires data movement).

When extending a record, be careful of the column starts. 151: says "start at position 151", so you don't want to have 150: for extending 150-byte records.
Back to top
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 61
Location: India

PostPosted: Wed Nov 26, 2014 3:38 pm    Post subject:
Reply with quote

Thanks for the information Bill.Thats new for me icon_smile.gif


Hi Basha,

Good it is working for you.Actually I just converted the words from Bill to SORT control statements icon_smile.gif


Cheers!!
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Wed Nov 26, 2014 3:50 pm    Post subject:
Reply with quote

Thanks Bill that was lots of information and learning.

Thanks Arun. Atlast gonna build my dynamic ISRSUPC JCL with dynamic input using above icon_smile.gif
Back to top
View user's profile Send private message
Arunkumar Chandrasekaran

New User


Joined: 01 Jun 2010
Posts: 61
Location: India

PostPosted: Wed Nov 26, 2014 3:56 pm    Post subject:
Reply with quote

thats cool Basha.
Back to top
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Mon Dec 15, 2014 3:25 pm    Post subject:
Reply with quote

Hi All,
I am about to finish my tool but got stuck at one place.

Is there any way that i can add a header and trailer to the above sort.

I have tried to add
TRAILER1=('OUTDD DD DISP=SHR,DSN=ME')
At the bottom of IFOUTLEN=51
But it's throws error.

Please help

Thanks
Basha
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Dec 15, 2014 5:34 pm    Post subject: Reply to: Editing First Line alone
Reply with quote

You have to show the code and the sysout from the step.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Dec 16, 2014 1:34 am    Post subject:
Reply with quote

Khadhar,

TRAILER1 is an OUTFIL subparameter and not OUTREC, I assume you have tried it with OUTREC, you might want to look at some OUTFIL TRAILER1 working examples here.

Similarly you can include a HEADER1 in the OUTFIL to write a report header.
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 Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts ISREDIT - Position Cursor on the Comm... Tarique Anwer TSO/ISPF 5 Wed Feb 03, 2016 12:44 pm
No new posts Use Edit Line Command Table with ISPF... Mickeydusaor TSO/ISPF 5 Thu Jan 28, 2016 4:52 pm
No new posts ISPF 3.4, SF line command does not su... Pedro TSO/ISPF 0 Fri Jan 15, 2016 11:09 pm
No new posts Editing "member generations"... Ricardo Viegas TSO/ISPF 1 Tue Dec 29, 2015 7:27 pm


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