Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : programming pearls - The fastest algorithm can frequently be replaced by one that is almost as fast and much easier to understand.

Google
 
Web mainframegurukul.com

Welcome to the mainframegurukul forums.

You are currently viewing our mainframe forums as a guest which gives you limited access to view most discussions, articles. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support at admin@mainframegurukul.com


Formatting in PS using DFSORT utility

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
udhay
Member


Joined: 29 Aug 2008
Posts: 2

PostPosted: Tue Sep 02, 2008 10:28 am    Post subject: Formatting in PS using DFSORT utility Reply with quote

Hi, I have a PS file with VB as a record format and it looks like below:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----
********************************* Top of Data ****************************
.?.&CUSTROOT...............................>LOANSEGM......................
.?...?CUSTROOT...................d..?BR02-T02PETER THOMAS 1900 STANFORD
.?...;LOANSEGM...................d?.;A1A1978 CHEV VAN .....
.?...?CUSTROOT......................?BR02-T01JAMES TAYLOR 5411 OCEAN DR.
.?...;LOANSEGM....................?.;H1HADDITION OF A FAMILY ROOM .....


This is basically an IMS unload file and I want to format it in a proper way like SEGMENT NAME (current position is 7), two spaces, then remaining VALID data starts from 38th position. All the in between data looks like various non-editable characters (ie. NULLs). I tried to MOVE spaces for the nulls using the DFSORT utility using the below command but I'm not able to format it correctly and even I tried some other commands also. Can anyone pl. let me know the solution for this?

//SYSIN DD *
OPTION COPY
ALTSEQ CODE=(0040)
OUTREC FIELDS=(20,31,TRAN=ALTSEQ)
/*

Finally I want the output dataset like below:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----
********************************* Top of Data ****************************
CUSTROOT LOANSEGM
CUSTROOT BR02-T02PETER THOMAS 1900 STANFORD
LOANSEGM A1A1978 CHEV VAN
CUSTROOT BR02-T01JAMES TAYLOR 5411 OCEAN DR.
LOANSEGM H1HADDITION OF A FAMILY ROOM

_________________
Udhay
Back to top
View user's profile Send private message

Frank Yaeger
Moderator


Joined: 18 Feb 2006
Posts: 487
Location: San Jose, CA

PostPosted: Tue Sep 02, 2008 10:09 pm    Post subject: Reply with quote

It's not clear if you're counting the RDW in positions 1-4 when giving the starting positions. I suspect you're not, so you need to add 4 to each starting position. If you want to create output records with the segment name, 2 spaces and the remaining valid data (assuming you weren't counting the RDW in the starting positions), and replace nulls with blanks, you can use DFSORT statements like this:

Code:

//S1    EXEC  PGM=ICEMAN                                           
//SYSOUT    DD  SYSOUT=*                                           
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)   
//SYSIN    DD    *                                                 
  OPTION COPY                                                     
  ALTSEQ CODE=(0040)                                               
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,11,8,2X,42)),                 
    IFTHEN=(WHEN=INIT,BUILD=(1,4,5,TRAN=ALTSEQ))     
/*


If you have z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can use the new FINDREP function instead of ALTSEQ and TRAN=ALTSEQ like this:

Code:
             
  OPTION COPY                                                     
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,11,8,2X,42)),                 
    IFTHEN=(WHEN=INIT,FINDREP=(IN=X'00',OUT=C' '))                 

_________________
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
udhay
Member


Joined: 29 Aug 2008
Posts: 2

PostPosted: Fri Sep 05, 2008 4:45 pm    Post subject: Formatting in PS using DFSORT utility Reply with quote

Thanks a lot Frank!!!
_________________
Udhay
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts delete a record in ps file. 4 white-shadow 193 Tue Jul 20, 2010 3:22 pm
Anuj Dhawan View latest post
No new posts Need JCL for the file prg-to copy content from 1 ps to other 4 sukamal 1060 Tue Dec 29, 2009 7:44 pm
Anuj Dhawan View latest post
No new posts Query For IEBPTPCH 2 padmajeet.gaikwad 1479 Mon Oct 26, 2009 10:25 am
padmajeet.gaikwad View latest post
No new posts Deleting a PS when the higher qualifier is mentioned 2 samrat.ganguly 842 Wed Mar 04, 2009 11:06 pm
Anuj Dhawan View latest post
No new posts comp and comp3 1 padmapriya7 6906 Mon Feb 06, 2006 12:27 am
prasad View latest post
 



This widget requires Flash Player 9 or better








Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB