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
 

 

Reformatting of O/P file based on I/P value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:09 pm    Post subject: Reformatting of O/P file based on I/P value
Reply with quote

I have an I/P file like following :

1CNCLABC123
2DCHGBCD456
3CNCLABC456
4DCHGBCD123

Layout :
1st byte = Sequence no
2-5 byte = Category
6-8 byte = Code1
9-11 byte = Code2

Requirement:
O/P file should contain only Category and Code, total 7 bytes in length.
If category = 'CNCL' ------> then code = Code1 (6-8 byte)
If Category = 'DCHG' -----> then code = Code2 (9-11 byte).

Please help me to do this one using SORT utility.
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Aug 10, 2010 11:14 pm    Post subject: Reply to: Reformatting of O/P file based on I/P value
Reply with quote

Debasis Misra,

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                   
1CNCLABC123                                       
2DCHGBCD456                                       
3CNCLABC456                                       
4DCHGBCD123                                       
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *
  INCLUDE COND=(2,4,SS,EQ,C'CNCL,DCHG')                                     
  SORT FIELDS=COPY                                 
  INREC IFOUTLEN=7,                               
  IFTHEN=(WHEN=(2,4,CH,EQ,C'CNCL'),BUILD=(2,7)),   
  IFTHEN=(WHEN=(2,4,CH,EQ,C'DCHG'),BUILD=(2,4,9,3))
//*                                               
Back to top
View user's profile Send private message
Debasis Misra
Warnings : 1

New User


Joined: 16 Sep 2008
Posts: 72
Location: Bangalore

PostPosted: Tue Aug 10, 2010 11:24 pm    Post subject:
Reply with quote

Thanks a lot!, its working, I have tried now.
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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