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
 

 

Inserting spaces in between the records in a PS file.

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

New User


Joined: 31 Oct 2012
Posts: 43
Location: INDIA

PostPosted: Fri Nov 02, 2012 12:45 pm    Post subject: Inserting spaces in between the records in a PS file.
Reply with quote

Hi all,
I have a PS file which has records in it.
The PS file looks like this.

Code:
42 000001 B80 0000
42 000001 S80 0000
42 000004 B80 0000
42 000004 S80 0000
42 000007 B80 0000
42 000007 S80 0000
42 000014 B80 0000


I have sorted the above PS file based on the second fields.

Now I wanted to insert a line of space in between the similar records.

Like this.
Code:
42 000001 B80 0000
42 000001 S80 0000

42 000004 B80 0000
42 000004 S80 0000

42 000007 B80 0000
42 000007 S80 0000

42 000014 B80 0000


Could any one explain the process on how to do this ?

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Fri Nov 02, 2012 12:54 pm    Post subject: Reply to: Inserting spaces in between the records in a PS fi
Reply with quote

On OUTFIL you can use the / (slash operator) to add additional records into the file. You can use the OUTFIL reporting functions, probably for this just SECTIONS will be enough, but look at HEADERn and TRAILERn at the same time. You'll need REMOVECC. Find out why.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Nov 02, 2012 1:01 pm    Post subject:
Reply with quote

Do you have group of two records or cannot be defined?
Back to top
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Fri Nov 02, 2012 2:06 pm    Post subject:
Reply with quote

Code:
//STEP0100 EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                           
42 000001 B80 0000                         
42 000001 S80 0000                         
42 000004 B80 0000                         
42 000004 S80 0000                         
42 000007 B80 0000                         
42 000007 S80 0000                         
42 000014 B80 0000                         
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
  OPTION COPY                             
  OUTFIL IFTHEN=(WHEN=(11,3,CH,EQ,C'S80'),
  BUILD=(1,21,/))                         


SORTOUT Output

Code:
42 000001 B80 0000
42 000001 S80 0000
                 
42 000004 B80 0000
42 000004 S80 0000
                 
42 000007 B80 0000
42 000007 S80 0000
                 
42 000014 B80 0000


try this
Back to top
View user's profile Send private message
tamminenisidhartha
Currently Banned

New User


Joined: 31 Oct 2012
Posts: 43
Location: INDIA

PostPosted: Mon Nov 05, 2012 10:34 am    Post subject: But this breaks at the very first record.
Reply with quote

@ezio vin.
I have executed this. But the first space is inserting after the first record as it satisfies the condition.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Nov 05, 2012 11:01 am    Post subject:
Reply with quote

Hi,

your data must be different than the one you have posted.


The first record is B80 not S80.


Gerry
Back to top
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Mon Nov 05, 2012 11:42 am    Post subject:
Reply with quote

what's your input data ??
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Nov 05, 2012 11:49 am    Post subject:
Reply with quote

Hi,

I just realised you have sorted the file on the second field only, hence the 3rd field could be in any order.

try this
Code:
  SORT FIELDS=(4,6,BI,A)                                             
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(4,6),PUSH=(81:ID=8,SEQ=8))     
  OUTFIL IFTHEN=(WHEN=(81,8,ZD,GT,+1,&,                             
                       89,8,ZD,EQ,+1),                               
  BUILD=(/,1,80))                                                   



Gerry
Back to top
View user's profile Send private message
tamminenisidhartha
Currently Banned

New User


Joined: 31 Oct 2012
Posts: 43
Location: INDIA

PostPosted: Mon Nov 05, 2012 12:45 pm    Post subject: Hi
Reply with quote

@ezio vin I have posted the input data in the question. Please refer it.
Back to top
View user's profile Send private message
ezio vin

New User


Joined: 16 Aug 2012
Posts: 44
Location: india

PostPosted: Mon Nov 05, 2012 12:50 pm    Post subject:
Reply with quote

i used the same input you gave in the sort input could you please check that in my post

did u change anything in sort card ?
Back to top
View user's profile Send private message
tamminenisidhartha
Currently Banned

New User


Joined: 31 Oct 2012
Posts: 43
Location: INDIA

PostPosted: Mon Nov 05, 2012 1:02 pm    Post subject:
Reply with quote

Hi
@gcicchet,

The space should be inserted based on the second field only. And what you said is right. The 3rd field could be in any order.

Thank you.
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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 1 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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