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
 

 

Which PIC clause to use space in alphanumeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mfhelp
Warnings : 1

New User


Joined: 29 Jun 2006
Posts: 33

PostPosted: Tue Oct 17, 2006 5:38 pm    Post subject: Which PIC clause to use space in alphanumeric
Reply with quote

i dont have the source code but this is the observation.....

X is an alphanumeric field containing 15 characters: 1234567<space>8<space><space><space><space><space><space>

this is moved to a field Y which report says contains <space><space><space>123456

what cud be the PIC clause of Y?
Back to top
View user's profile Send private message

sridevi2005

New User


Joined: 15 Sep 2005
Posts: 42

PostPosted: Tue Oct 17, 2006 5:46 pm    Post subject: Re: what cud be the PIC clause?
Reply with quote

I think PIC 9(6).
Back to top
View user's profile Send private message
mfhelp
Warnings : 1

New User


Joined: 29 Jun 2006
Posts: 33

PostPosted: Tue Oct 17, 2006 5:50 pm    Post subject:
Reply with quote

i dont think so coz if destination field had been numeric, filling wud have started from right side.......meaning rightmost of source to rightmost of destination.......now right side contains 6 spaces so Y wud have displayed all spaces.......

correct me if i m wrong.
Back to top
View user's profile Send private message
ihatesugar
Warnings : 1

New User


Joined: 22 Oct 2006
Posts: 43

PostPosted: Sun Oct 22, 2006 5:50 pm    Post subject: Re: Which PIC clause to use space in alphanumeric
Reply with quote

It has to be PIC(09) and if the movement must be right justified!!!
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Sun Oct 22, 2006 9:03 pm    Post subject:
Reply with quote

Without the source code it is impossible to say exactly what happens.
Here are some possible solutions:
Code:
01  FIELD-X.
    03  FIELD-X1  PIC X(6).
    03  FIELD-X2  PIC X(9).
01  FIELD-Y  PIC X(9)  JUSTIFIED RIGHT.
01  FIELD-Z  PIC Z(9).

    MOVE FIELD-X(1:6) TO FIELD-Y
    MOVE FIELD-X(1:6) TO FIELD-Z
    MOVE FIELD-X1 TO FIELD-Y
    MOVE FIELD-X1 TO FIELD-Z

All these MOVEs lead to the same result.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Oct 23, 2006 7:05 am    Post subject: Re: Which PIC clause to use space in alphanumeric
Reply with quote

What Marso shown would produce "$$$123456" to the output variable, where $= Spaces.
Coming to the original question:-
Quote:
what cud be the PIC clause of Y?

As you said value for this field is "$$$123456"
It is containing spaces- It cant be a numeric field.
It is having numbers- It cant be a alphabetic field.
It is having spaces & numbers- It MUST be an alphanumeric field.

So answer is X(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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


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