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
 

 

How to find non-blank character in a column and to change it

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Mon May 28, 2007 1:35 pm    Post subject: How to find non-blank character in a column and to change it
Reply with quote

Hi,

My requirement is as follows:

I have one input file with first 10bytes as the key.

Input Data in the first 10 bytes is as follows:
ABCDEADJ01
ABCDEADJ02
ABCDEADJ03
ABCDEADJ04
ABCDEADJ05
ABCDEAFK01
ABCDE4NPAA
ABCDE4NPAB
ABCDE4NPAC
ABCDE4NPAD
ABCDE4NPAE

Now my requirement is I want to maintain the key as first 10 bytes only but I want the data as follows:
ABDEADJ001
ABDEADJ002
ABDEADJ003
ABDEADJ004
ABDEADJ005
ABDEAFK001
ABDE4NPAA
ABDE4NPAB
ABDE4NPAC
ABDE4NPAD
ABDE4NPAE

The actual requirement is as follows:
1. I want to change first 5 bytes to 4 bytes only..............
i.e. ABCDE will change to ABDE
2. I want to add 8th character as follows
if 9th byte has numeric value I should populate 8th byte as zero and
if 9th byte has character No need to populate any thing in 8th byte but I should move 9th and 10th characters to 8th and 9th positions and 10th character should be space.

Please Note : Previously the key is 5,5 after requirement it should change to 6,4.............

I hope you understood my requirement.

May I know whether it can be done using JCL 3.4 commands or using any JCL sort or any other way to do this......

Thx in advance..........

pavan
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Mon May 28, 2007 2:04 pm    Post subject:
Reply with quote

Pavan,

The following SORT CARD might do the trick for you. Please remeber this card is not tested.

Code:

//SYSIN DD *
  INREC FIELDS=(1,2,    * FIRST 2 CHARACTERS
                4,5,    * SKIP OUT 3 CHARACTER AND START FRM 4
                C' ',   * BLANK OUT 8th POS TEMPROARILY
                9,n)   * WHERE n=LRECL-8

  SORT FIELDS=COPY

  OUTREC IFTHEN=(WHEN=(9,1,FS,EQ,NUM),
                OVERLAY=(8:C'0'))
         IFTHEN=(WHEN=(9,1,FS,NE,NUM),
                OVERLAY=(8:9,2,        * MOVE 9, 10 POS to 8, 9 Pos
                         10:C' ')      * BLANK OUT 10 COLUMN     
/*
Back to top
View user's profile Send private message
i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Mon May 28, 2007 5:51 pm    Post subject: hi murmohk1
Reply with quote

First of all thank for quick reply.

But, May I know is NUM is keyword to check numercis as I am getting the error when I am using this NUM.....

Please suggest...

pavan
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon May 28, 2007 7:25 pm    Post subject:
Reply with quote

yes NUM is a keyword.

Please paste the snapshot of the error that you are facing
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon May 28, 2007 10:11 pm    Post subject:
Reply with quote

pavan,

You need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's NUM function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

But since you posted in the JCL Forum rather than the DFSORT Forum, I assume you have Syncsort. not DFSORT. Syncsort doesn't support the NUM function.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue May 29, 2007 8:33 pm    Post subject:
Reply with quote

I guess this should be enough in ISPF 3.4 options.
c all 'c' '' 3
c all '0' '00' 9.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


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