IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Read input & Append String


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shaheen Kalokhe

New User


Joined: 21 Feb 2008
Posts: 21
Location: India

PostPosted: Mon Nov 09, 2009 5:39 pm
Reply with quote

I have an FB dataset having the following data at column 21-32

110000000000
101000000000
001000010001

Each digit corresponds to a month. My requirement is that if
110000000000 is read from input file the ouputfile should have
Jan Feb

Similalrly for 101000000000 output should be
Jan Mar

Similalrly for 001000010001 output should be
Mar Aug Dec

Thanks
Shaheen
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Nov 09, 2009 10:03 pm
Reply with quote

Shaheen Kalokhe,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
----+----1----+----2----+----3----+----4----+----5----+--
                    110000000000                         
                    101000000000                         
                    001000010001                         
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INREC IFTHEN=(WHEN=INIT,                               
  OVERLAY=(81:C'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC')),
  IFTHEN=(WHEN=(21,1,ZD,EQ,0),OVERLAY=(081:3X),HIT=NEXT),
  IFTHEN=(WHEN=(22,1,ZD,EQ,0),OVERLAY=(084:3X),HIT=NEXT),
  IFTHEN=(WHEN=(23,1,ZD,EQ,0),OVERLAY=(087:3X),HIT=NEXT),
  IFTHEN=(WHEN=(24,1,ZD,EQ,0),OVERLAY=(090:3X),HIT=NEXT),
  IFTHEN=(WHEN=(25,1,ZD,EQ,0),OVERLAY=(093:3X),HIT=NEXT),
  IFTHEN=(WHEN=(26,1,ZD,EQ,0),OVERLAY=(096:3X),HIT=NEXT),
  IFTHEN=(WHEN=(27,1,ZD,EQ,0),OVERLAY=(099:3X),HIT=NEXT),
  IFTHEN=(WHEN=(28,1,ZD,EQ,0),OVERLAY=(102:3X),HIT=NEXT),
  IFTHEN=(WHEN=(29,1,ZD,EQ,0),OVERLAY=(105:3X),HIT=NEXT),
  IFTHEN=(WHEN=(30,1,ZD,EQ,0),OVERLAY=(108:3X),HIT=NEXT),
  IFTHEN=(WHEN=(31,1,ZD,EQ,0),OVERLAY=(111:3X),HIT=NEXT),
  IFTHEN=(WHEN=(32,1,ZD,EQ,0),OVERLAY=(114:3X),HIT=NEXT)
  OUTREC IFOUTLEN=80,                                   
  IFTHEN=(WHEN=INIT,OVERLAY=(35:81,36,SQZ=(SHIFT=LEFT)))
/*   


the output from the above job is

Code:

                    110000000000  JANFEB   
                    101000000000  JANMAR   
                    001000010001  MARAUGDEC
Back to top
View user's profile Send private message
Shaheen Kalokhe

New User


Joined: 21 Feb 2008
Posts: 21
Location: India

PostPosted: Tue Nov 10, 2009 7:58 pm
Reply with quote

Skolusu

Thanks a ton,

It worked fine for us.

Have a good day

Thanks & Regards
Shaheen
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top